Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
---
 iprconfig.c | 30 ++++++++++++++++++++++++++++++
 iprconfig.h | 16 +++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/iprconfig.c b/iprconfig.c
index 4ab7562..016e8a1 100644
--- a/iprconfig.c
+++ b/iprconfig.c
@@ -11717,6 +11717,36 @@ int choose_ucode(i_container * i_con)
        return 0;
 }
 
+/**
+* ucode_screen - Configure microcode screen
+* @i_con:            i_container struct
+*
+* Returns:
+*   0 if success / non-zero on failure
+**/
+int ucode_screen(i_container *i_con)
+{
+       int rc;
+       struct screen_output *s_out;
+       int loop;
+
+       for (loop = 0; loop < n_ucode_screen.num_opts; loop++) {
+               n_ucode_screen.body =
+                       ipr_list_opts(n_ucode_screen.body,
+                                     n_ucode_screen.options[loop].key,
+                                     n_ucode_screen.options[loop].list_str);
+       }
+
+       n_ucode_screen.body = ipr_end_list(n_ucode_screen.body);
+
+       s_out = screen_driver(&n_ucode_screen, 0, NULL);
+       free(n_ucode_screen.body);
+       n_ucode_screen.body = NULL;
+       rc = s_out->rc;
+       free(s_out);
+       return rc;
+}
+
 #define MAX_CMD_LENGTH 1000
 
 /**
diff --git a/iprconfig.h b/iprconfig.h
index 6b42ab2..9e91152 100644
--- a/iprconfig.h
+++ b/iprconfig.h
@@ -135,6 +135,7 @@ int disk_config(i_container * i_con);
 int ioa_config(i_container * i_con);
 int change_disk_config(i_container *);
 int change_ioa_config(i_container *);
+int ucode_screen(i_container *i_con);
 int download_ucode(i_container *);
 int choose_ucode(i_container *);
 int log_menu(i_container *);
@@ -194,7 +195,7 @@ struct screen_opts main_menu_opt[] = {
        {driver_config,      "5", __("Work with driver configuration")},
        {disk_config,        "6", __("Work with disk configuration")},
        {ioa_config,         "7", __("Work with adapter configuration")},
-       {download_ucode,     "8", __("Download microcode")},
+       {ucode_screen,       "8", __("Work with Microcode updates")},
        {log_menu,           "9", __("Analyze log")},
 };
 
@@ -1556,6 +1557,19 @@ s_node n_confirm_set_default_editor = {
                "" }
 };
 
+
+struct screen_opts ucode_screen_opt[] = {
+       {download_ucode,      "1", __("Download microcode")},
+};
+
+s_node n_ucode_screen = {
+       .rc_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG),
+       .f_flags  = (EXIT_FLAG | CANCEL_FLAG),
+       .num_opts = NUM_OPTS(ucode_screen_opt),
+       .options  = &ucode_screen_opt[0],
+       .title    = __("Work with microcode update")
+};
+
 const char *screen_status[] = {
        /*  0 */ "",
        /*  1 */ "",
-- 
2.1.0


------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to