2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2019-03-26 11:59:46 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-11-05 15:40:03 +03:00
|
|
|
#include <cstdint>
|
|
|
|
|
#include <limits>
|
2017-12-21 00:45:38 +01:00
|
|
|
#include <string>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-03-27 13:28:54 +01:00
|
|
|
struct HardwareInfo;
|
2017-12-21 00:45:38 +01:00
|
|
|
class OSInterface;
|
|
|
|
|
|
2020-11-05 15:40:03 +03:00
|
|
|
struct PhysicalDevicePciBusInfo {
|
|
|
|
|
PhysicalDevicePciBusInfo(uint32_t domain, uint32_t bus, uint32_t device, uint32_t function)
|
|
|
|
|
: pciDomain(domain), pciBus(bus), pciDevice(device), pciFunction(function) {}
|
|
|
|
|
|
|
|
|
|
uint32_t pciDomain;
|
|
|
|
|
uint32_t pciBus;
|
|
|
|
|
uint32_t pciDevice;
|
|
|
|
|
uint32_t pciFunction;
|
|
|
|
|
|
|
|
|
|
static const uint32_t InvalidValue = std::numeric_limits<uint32_t>::max();
|
|
|
|
|
};
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
class DriverInfo {
|
|
|
|
|
public:
|
2020-11-05 15:40:03 +03:00
|
|
|
DriverInfo()
|
|
|
|
|
: pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue) {}
|
|
|
|
|
|
|
|
|
|
static DriverInfo *create(const HardwareInfo *hwInfo, const OSInterface *osInterface);
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
virtual ~DriverInfo() = default;
|
|
|
|
|
|
2020-03-27 13:28:54 +01:00
|
|
|
virtual std::string getDeviceName(std::string defaultName) { return defaultName; }
|
|
|
|
|
virtual std::string getVersion(std::string defaultVersion) { return defaultVersion; }
|
|
|
|
|
virtual bool getMediaSharingSupport() { return true; }
|
|
|
|
|
virtual bool getImageSupport() { return true; }
|
2020-11-05 15:40:03 +03:00
|
|
|
virtual PhysicalDevicePciBusInfo getPciBusInfo() { return pciBusInfo; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
PhysicalDevicePciBusInfo pciBusInfo;
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|