Support PCIe vendor name

Add the support for PCIe vendor name.

Change-Id: Ibc1d289a08731e4c5a14f992f3b0d31b51482396
This commit is contained in:
Bill(Shuzhou) Liu
2023-08-28 08:21:20 -05:00
parent 14190c5a94
commit 9021ef96dc
12 ha cambiato i file con 161 aggiunte e 16 eliminazioni
+37
Vedi File
@@ -1155,6 +1155,43 @@ rsmi_status_t rsmi_dev_sku_get(uint32_t dv_ind, uint16_t *sku);
*/
rsmi_status_t rsmi_dev_vendor_id_get(uint32_t dv_ind, uint16_t *id);
/**
* @brief Get the name string for a give PCIe vendor ID
*
* @details Given a device index @p dv_ind, a pointer to a caller provided
* char buffer @p name, and a length of this buffer @p len, this function will
* write the name of the PCIe vendor (up to @p len characters) buffer @p name.
*
* If the integer ID associated with the PCIe vendor is not found in one of the
* system files containing device name information (e.g.
* /usr/share/misc/pci.ids), then this function will return RSMI_STATUS_NOT_FOUND.
* Updating the system name files can be accompplished with
* "sudo update-pciids".
*
* @param[in] dv_ind a device index
*
* @param[inout] name a pointer to a caller provided char buffer to which the
* name will be written
* If this parameter is nullptr, this function will return
* ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,
* arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the
* provided arguments.
*
* @param[in] len the length of the caller provided buffer @p name.
*
* @retval ::RSMI_STATUS_SUCCESS call was successful
* @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function with the given arguments
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
* @retval ::RSMI_STATUS_NOT_FOUND the vnedor name are not found
* @retval ::RSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not
* large enough to hold the entire name. In this case, only @p len bytes will
* be written.
*
*/
rsmi_status_t rsmi_dev_pcie_vendor_name_get(uint32_t dv_ind, char *name,
size_t len);
/**
* @brief Get the name string of a gpu device.
*
@@ -167,7 +167,12 @@ enum DevInfoTypes {
kDevGpuReset,
kDevAvailableComputePartition,
kDevComputePartition,
kDevMemoryPartition
kDevMemoryPartition,
// The information read from pci core sysfs
kDevPCieTypeStart = 1000,
kDevPCieVendorID = kDevPCieTypeStart,
kDevPCieTypeEND = 2000,
};
typedef struct {
@@ -103,6 +103,7 @@ std::tuple<bool, std::string, std::string, std::string, std::string,
getSystemDetails(void);
void logSystemDetails(void);
rsmi_status_t getBDFString(uint64_t bdf_id, std::string& bfd_str);
rsmi_status_t getBDFWithDomain(uint64_t bdf_id, std::string& bfd_str);
void logHexDump(const char *desc, const void *addr, const size_t len,
size_t perLine);
bool isSystemBigEndian();