2020-03-06 11:09:57 +01:00
|
|
|
/*
|
2022-03-08 08:37:49 +05:30
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-03-06 11:09:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-03-22 08:52:57 +01:00
|
|
|
#include "level_zero/tools/source/sysman/os_sysman.h"
|
2020-03-06 11:09:57 +01:00
|
|
|
#include <level_zero/zet_api.h>
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace L0 {
|
2021-03-18 10:37:08 +05:30
|
|
|
int64_t convertPcieSpeedFromGTsToBs(double maxLinkSpeedInGt);
|
2020-08-14 01:19:58 -07:00
|
|
|
int32_t convertLinkSpeedToPciGen(double speed);
|
|
|
|
|
double convertPciGenToLinkSpeed(uint32_t gen);
|
2020-03-06 11:09:57 +01:00
|
|
|
class OsPci {
|
|
|
|
|
public:
|
2022-03-08 08:37:49 +05:30
|
|
|
virtual ze_result_t getPciBdf(zes_pci_properties_t &pciProperties) = 0;
|
2022-06-08 13:35:47 +00:00
|
|
|
virtual void getMaxLinkCaps(double &maxLinkSpeed, int32_t &maxLinkWidth) = 0;
|
2020-08-14 01:19:58 -07:00
|
|
|
virtual ze_result_t getState(zes_pci_state_t *state) = 0;
|
|
|
|
|
virtual ze_result_t getProperties(zes_pci_properties_t *properties) = 0;
|
2021-06-22 19:03:31 -07:00
|
|
|
virtual bool resizableBarSupported() = 0;
|
2021-07-30 13:33:54 +00:00
|
|
|
virtual bool resizableBarEnabled(uint32_t barIndex) = 0;
|
2020-07-29 02:45:54 -07:00
|
|
|
virtual ze_result_t initializeBarProperties(std::vector<zes_pci_bar_properties_t *> &pBarProperties) = 0;
|
2020-03-06 11:09:57 +01:00
|
|
|
static OsPci *create(OsSysman *pOsSysman);
|
2020-04-03 13:19:17 +05:30
|
|
|
virtual ~OsPci() = default;
|
2020-03-06 11:09:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace L0
|