summaryrefslogtreecommitdiffstats
path: root/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c')
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c
deleted file mode 100644
index 93c1166..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * fpc-util
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <facebook/bic.h>
-#include <openbmc/pal.h>
-#include <openbmc/ipmi.h>
-
-static void
-print_usage_help(void) {
- printf("Usage: fpc-util <slot1|slot2|slot3|slot4> --usb\n");
- printf(" fpc-util <slot1|slot2|slot3|slot4|all> --identify <on/off>\n");
-}
-
-int
-main(int argc, char **argv) {
-
- uint8_t slot_id;
- char tstr[64] = {0};
-
- if (argc < 3) {
- goto err_exit;
- }
-
- if (!strcmp(argv[1], "slot1")) {
- slot_id = 1;
- } else if (!strcmp(argv[1] , "slot2")) {
- slot_id = 2;
- } else if (!strcmp(argv[1] , "slot3")) {
- slot_id = 3;
- } else if (!strcmp(argv[1] , "slot4")) {
- slot_id = 4;
- } else if (!strcmp(argv[1] , "all")) {
- slot_id = 0;
- } else {
- goto err_exit;
- }
-
- if (!strcmp(argv[2], "--usb")) {
- printf("fpc-util: switching USB channel to slot%d\n", slot_id);
- return pal_switch_usb_mux(slot_id);
- } else if (!strcmp(argv[2], "--identify")) {
- if (argc != 4) {
- goto err_exit;
- }
- printf("fpc-util: identication for %s is %s\n", argv[1], argv[3]);
- if (slot_id == 0) {
- sprintf(tstr, "identify_sled");
- } else {
- sprintf(tstr, "identify_slot%d", slot_id);
- }
-
- return pal_set_key_value(tstr, argv[3]);
- } else {
- goto err_exit;
- }
-
- return 0;
-err_exit:
- print_usage_help();
- return -1;
-}
OpenPOWER on IntegriCloud