From 477d356ffb4f510fb91e9ee1656bf63906d79830 Mon Sep 17 00:00:00 2001 From: germeier Date: Fri, 18 Apr 2003 13:53:00 +0000 Subject: implemented "health" function. this is UNTESTED! --- mpiosh/callback.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- mpiosh/callback.h | 3 ++- mpiosh/global.c | 5 ++++- 3 files changed, 59 insertions(+), 3 deletions(-) (limited to 'mpiosh') diff --git a/mpiosh/callback.c b/mpiosh/callback.c index 28c0284..b252f24 100644 --- a/mpiosh/callback.c +++ b/mpiosh/callback.c @@ -2,7 +2,7 @@ * * Author: Andreas Büsching * - * $Id: callback.c,v 1.37 2003/04/11 22:53:10 germeier Exp $ + * $Id: callback.c,v 1.38 2003/04/18 13:53:01 germeier Exp $ * * Copyright (C) 2001 Andreas Büsching * @@ -709,6 +709,7 @@ mpiosh_cmd_format(char *args[]) } } + mpiosh_cmd_health(NULL); } } @@ -744,6 +745,57 @@ mpiosh_cmd_dump_mem(char *args[]) } +void +mpiosh_cmd_health(char *args[]) +{ + mpio_health_t health; + int i, lost; + + UNUSED(args); + + MPIOSH_CHECK_CONNECTION_CLOSED; + + mpio_health(mpiosh.dev, mpiosh.card, &health); + + if (mpiosh.card == MPIO_INTERNAL_MEM) { + lost=0; + printf("health status of internal memory:\n"); + printf("=================================\n"); + printf("%d chip%c (total/spare/broken)\n", + health.num, ((health.num==1)?' ':'s')); + for(i=0; i * - * $Id: callback.h,v 1.8 2003/04/06 23:09:20 germeier Exp $ + * $Id: callback.h,v 1.9 2003/04/18 13:53:02 germeier Exp $ * * Copyright (C) 2001 Andreas Büsching * @@ -50,6 +50,7 @@ void mpiosh_cmd_free(char *args[]); void mpiosh_cmd_format(char *args[]); void mpiosh_cmd_switch(char *args[]); void mpiosh_cmd_dump_mem(char *args[]); +void mpiosh_cmd_health(char *args[]); void mpiosh_cmd_config(char *args[]); void mpiosh_cmd_channel(char *args[]); diff --git a/mpiosh/global.c b/mpiosh/global.c index 4bfe7b5..7910eff 100644 --- a/mpiosh/global.c +++ b/mpiosh/global.c @@ -2,7 +2,7 @@ * * Author: Andreas Buesching * - * $Id: global.c,v 1.8 2003/04/06 23:09:20 germeier Exp $ + * $Id: global.c,v 1.9 2003/04/18 13:53:02 germeier Exp $ * * Copyright (C) 2001 Andreas Büsching * @@ -117,6 +117,9 @@ struct mpiosh_cmd_t commands[] = { { "lmkdir", NULL, NULL, " create a local directory", mpiosh_cmd_lmkdir, NULL }, + { "health", NULL, NULL, + " show the health status from the selected memory", + mpiosh_cmd_health, NULL }, { "dump_memory", NULL, NULL, " dump FAT, directory, spare area and the first 0x100 of the\n" " selected memory card", -- cgit v1.2.3