Add Set Package and Channel Mask to ncsi-netlink utility
The NCSI driver has added two commands for setting the Package Mask
and the Channel Mask within a package. The ncsi-netlink utility does
not support these new commands.
Add the ability to set the package and the channel mask values.
Tested:
Instrumented the NCSI kernel driver to print mask values.
Issued 'ncsi-netlink -x 3 -j 0x3' and saw the NCSI driver print the
new package mask.
Issued 'ncsi-netlink -x 3 -p 0 -k 0x3' and saw the NCSI driver
print the new channel mask.
Change-Id: Icd2188e789de43f631fe26d9e751d564ba5f822f
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/src/argument.cpp b/src/argument.cpp
index 6bc40bc..16d855c 100644
--- a/src/argument.cpp
+++ b/src/argument.cpp
@@ -15,9 +15,7 @@
*/
#include "argument.hpp"
-#include <algorithm>
#include <iostream>
-#include <iterator>
namespace phosphor
{
@@ -76,6 +74,8 @@
" --set | -s Set a specific package/channel.\n"
" --clear | -r Clear all the settings on the interface.\n"
" --oem-payload=<hex data...> | -o <hex data...> Send an OEM command with payload.\n"
+ " --pmask=<mask> | -j <mask> Bitmask to enable/disable packages\n"
+ " --cmask=<mask> | -k <mask> Bitmask to enable/disable channels\n"
"\n"
"Example commands:\n"
" 1) Retrieve topology information:\n"
@@ -88,6 +88,10 @@
" ncsi-netlink -x 3 -p 0 -r\n"
" 5) Send NCSI Command\n"
" ncsi-netlink -x 3 -p 0 -c 0 -o 50000001572100\n"
+ " 6) Set Package Mask\n"
+ " ncsi-netlink -x 3 -j 1\n"
+ " 7) Set Channel Mask\n"
+ " ncsi-netlink -x 3 -p 0 -k 1\n"
"\n";
}
@@ -100,10 +104,12 @@
{"channel", required_argument, NULL, 'c'},
{"index", required_argument, NULL, 'x'},
{"help", no_argument, NULL, 'h'},
+ {"pmask", required_argument, NULL, 'j'},
+ {"cmask", required_argument, NULL, 'k'},
{0, 0, 0, 0},
};
-const char* ArgumentParser::optionStr = "irsx:o:p:c:h?";
+const char* ArgumentParser::optionStr = "irsj:k:x:o:p:c:h?";
const std::string ArgumentParser::trueString = "true";
const std::string ArgumentParser::emptyString = "";