aboutsummaryrefslogtreecommitdiff
path: root/modules/devices/spd-decode.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-05-19 19:10:20 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-05-25 14:13:36 -0700
commitbcd25fe4421acbac0af1a4f5cfb1964abfaa7ed5 (patch)
treee01ab7294147f071157230a58313a77f9e7439da /modules/devices/spd-decode.c
parentf0990c37302ddb0ebeb45d2518f3335ae94103c2 (diff)
spd-decode.c: specify shell viewtype for error condition and use hinote for messages
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/spd-decode.c')
-rw-r--r--modules/devices/spd-decode.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c
index e329f577..831d59a5 100644
--- a/modules/devices/spd-decode.c
+++ b/modules/devices/spd-decode.c
@@ -854,6 +854,8 @@ static const char *vendors7[] = {"MOVEKING",
static const char **vendors[VENDORS_BANKS] = {vendors1, vendors2, vendors3, vendors4,
vendors5, vendors6, vendors7};
+gboolean no_driver = FALSE;
+gboolean no_support = FALSE;
gboolean ddr4_partial_data = FALSE;
/*
@@ -1689,6 +1691,9 @@ void scan_spd_do(void) {
const gchar *dir_path = NULL;
int max_size = 256;
+ no_driver = FALSE;
+ no_support = FALSE;
+
if (g_file_test("/sys/bus/i2c/drivers/ee1004", G_FILE_TEST_EXISTS)) {
dir_path = "/sys/bus/i2c/drivers/ee1004";
max_size = 512;
@@ -1704,14 +1709,17 @@ void scan_spd_do(void) {
if (!dir) {
g_free(spd_info);
if (!g_file_test("/sys/module/eeprom", G_FILE_TEST_EXISTS)) {
+ no_driver = TRUE; /* trigger hinote for no eeprom driver */
spd_info =
- g_strdup(_("[SPD]\n"
- "Please load the eeprom module to obtain information about memory SPD=\n"
- "[$ShellParam$]\n"
- "ReloadInterval=500\n"));
+ g_strdup("[$ShellParam$]\n"
+ "ViewType=0\n"
+ "ReloadInterval=500\n");
} else {
- spd_info = g_strdup(_("[SPD]\n"
- "Reading memory SPD not supported on this system=\n"));
+ no_support = TRUE; /* trigger hinote for unsupported system */
+ spd_info =
+ g_strdup("[$ShellParam$]\n"
+ "ViewType=0\n"
+ "ReloadInterval=500\n");
}
return;
@@ -1749,6 +1757,16 @@ gboolean spd_decode_show_hinote(const char **msg) {
"configure ee1004 driver to obtain additional information about DDR4 SPD."));
return TRUE;
}
+ if (no_driver) {
+ *msg = g_strdup(
+ _("Please load the eeprom module to obtain information about memory SPD."));
+ return TRUE;
+ }
+ if (no_support) {
+ *msg = g_strdup(
+ _("Reading memory SPD not supported on this system."));
+ return TRUE;
+ }
return FALSE;
}