mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
Cr50: cleanup: Rename the "sps" console command "spshc"
The "sps" console command declared in sps_hc.c is misleading. It shouldn't be "sps", when it's actually part of the host command protocol stuff. This CL changes the command name to "spshc" instead. The command just enables or disables SPS host commands. Note that because there's no notification if something else calls sps_unregister_rx_handler(), there's no way for the sps_hc.c module to know whether it's still registered. BUG=none BRANCH=none TEST=make buildall Using a test program, such as extra/ftdi_hostcmd/, I can send host commands to an EC attached via an FTDI USB-to-SPI adapter. On the EC console, this: spshc off causes the test program to fail, and this: spshc causes it to work again. Change-Id: Ie0edbde179b570f170ff9464313e5e33ab985f21 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284942 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
10dc22867f
commit
4c708232ac
@@ -290,22 +290,20 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO,
|
||||
static int command_sps(int argc, char **argv)
|
||||
{
|
||||
if (argc > 1) {
|
||||
if (!strcasecmp(argv[1], "reset") ||
|
||||
!strcasecmp(argv[1], "on"))
|
||||
sps_hc_enable();
|
||||
else if (!strcasecmp(argv[1], "off"))
|
||||
sps_hc_disable();
|
||||
else
|
||||
if (0 != strcasecmp(argv[1], "off"))
|
||||
return EC_ERROR_PARAM1;
|
||||
|
||||
sps_hc_disable();
|
||||
ccprintf("SPS host commands disabled\n");
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
ccprintf("state=%d rxbuf_count=%d rxbuf_needed=%d, discard=%d\n",
|
||||
state, rxbuf_count, rxbuf_needed, discard_response);
|
||||
|
||||
sps_hc_enable();
|
||||
ccprintf("SPS host commands enabled\n");
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
DECLARE_CONSOLE_COMMAND(sps, command_sps,
|
||||
"[reset|off|on]",
|
||||
"With no args, print some info",
|
||||
DECLARE_CONSOLE_COMMAND(spshc, command_sps,
|
||||
"[off]",
|
||||
"Enable (default) or disable SPS host commands",
|
||||
NULL);
|
||||
|
||||
Reference in New Issue
Block a user