SWDEV-410051 - Updates to board_info struct & CLI
Signed-off-by: Maisam Arif <maisarif@amd.com> Change-Id: I8735d8965140ee5da0c35106b388af1dca87ec71
This commit is contained in:
@@ -466,15 +466,10 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand
|
||||
status = rsmi_wrapper(rsmi_dev_name_get, processor_handle,
|
||||
board_info->product_name, AMDSMI_PRODUCT_NAME_LENGTH);
|
||||
|
||||
if (board_info->product_serial[0] == '\0') {
|
||||
status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle,
|
||||
status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle,
|
||||
board_info->product_serial, AMDSMI_NORMAL_STRING_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
// Get FRU ID
|
||||
// Get manufacturer name
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,29 +116,41 @@ amdsmi_status_t smi_amdgpu_get_board_info(amd::smi::AMDSmiGPUDevice* device, amd
|
||||
return AMDSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
SMIGPUDEVICE_MUTEX(device->get_mutex())
|
||||
std::string product_name_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/product_name");
|
||||
std::string product_number_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/product_number");
|
||||
std::string serial_number_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/serial_number");
|
||||
std::string model_number_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/product_number");
|
||||
std::string product_serial_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/serial_number");
|
||||
std::string fru_id_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/fru_id");
|
||||
std::string manufacturer_name_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/manufacturer");
|
||||
std::string product_name_path = "/sys/class/drm/" + device->get_gpu_path() + std::string("/device/product_name");
|
||||
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(product_name_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fgets(info->product_name, sizeof(info->product_name), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
fp = fopen(product_number_path.c_str(), "rb");
|
||||
fp = fopen(model_number_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fgets(info->model_number, sizeof(info->model_number), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
fp = fopen(serial_number_path.c_str(), "rb");
|
||||
fp = fopen(product_serial_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fscanf(fp, "%lx", &info->product_serial);
|
||||
fgets(info->product_serial, sizeof(info->product_serial), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
fp = fopen(fru_id_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fgets(info->fru_id, sizeof(info->fru_id), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
fp = fopen(manufacturer_name_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fgets(info->manufacturer_name, sizeof(info->manufacturer_name), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
fp = fopen(product_name_path.c_str(), "rb");
|
||||
if (fp) {
|
||||
fgets(info->product_name, sizeof(info->product_name), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user