summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2022-03-14 18:56:04 +0000
committerBrian Norris <briannorris@chromium.org>2022-03-14 20:07:50 +0000
commit7e3c1b6d4024d758fd49c6e134b2d73ec64e72a7 (patch)
treeffe68af7798b03372c9a0bf856b2603c788de768
parentd4b3156ccadb281842b22bb3bd2ad41ab1da5c9b (diff)
downloadchrome-ec-stabilize-14588.98.B-cr50_stab.tar.gz
This reverts commit d4b3156ccadb281842b22bb3bd2ad41ab1da5c9b. Reason for revert: new warnings/errors cause build failures b/224575372 Original change's description: > gsctool: add support for USER_PRES vc > > Add support for sending and interpreting the user_pres vendor command. > > BUG=b:208504127 > TEST=none > > Change-Id: I7e20f448011ffb2a15ae352a4c1e49b72afa015d > Signed-off-by: Mary Ruthven <mruthven@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3495864 > Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Bug: b:208504127, b:224575372 Change-Id: I4a6c8813da5c4ed31ac6adcb410d6869ca7ec9ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3523383 Owners-Override: Brian Norris <briannorris@chromium.org> Auto-Submit: Brian Norris <briannorris@chromium.org> Commit-Queue: Brian Norris <briannorris@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com> Commit-Queue: Abhishek Pandit-Subedi <abhishekpandit@google.com>
-rw-r--r--extra/usb_updater/gsctool.c66
1 files changed, 1 insertions, 65 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index fac2d20787..16a83025bb 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -339,9 +339,7 @@ static const struct option_container cmd_line_options[] = {
{{"version", no_argument, NULL, 'v'},
"Report this utility version"},
{{"wp", optional_argument, NULL, 'w'},
- "[enable] Get the current WP setting or enable WP"},
- {{"user_pres", optional_argument, NULL, 'z'},
- "Enable or check user_pres_l status"},
+ "[enable] Get the current WP setting or enable WP"}
};
/* Helper to print debug messages when verbose flag is specified. */
@@ -2670,58 +2668,6 @@ static void process_rma(struct transfer_descriptor *td, const char *authcode)
}
/*
- * Enable or disable user pres tracking. Get time since DIOM4 was asserted.
- */
-static int process_user_pres(struct transfer_descriptor *td, const char *arg)
-{
- struct user_pres_response response;
- size_t response_size = sizeof(response);
- char *cmd_str;
- int rv;
- uint8_t *subcmd;
- uint8_t subcmd_size = 1;
-
- if (!arg) {
- subcmd = NULL;
- subcmd_size = 0;
- cmd_str = "check";
- } else if (!strcasecmp(arg, "disable")) {
- *subcmd = USER_PRES_DISABLE;
- cmd_str = "disable";
- } else if (!strcasecmp(arg, "enable")) {
- *subcmd = USER_PRES_ENABLE;
- cmd_str = "enable";
-
- } else {
- fprintf(stderr, "Invalid user pres arg %s", arg);
- return update_error;
- }
-
- rv = send_vendor_command(td, VENDOR_CC_USER_PRES, subcmd, subcmd_size,
- &response, &response_size);
- if (rv) {
- fprintf(stderr, "Failed %s user pres\nvc error "
- "%d\n", cmd_str, rv);
- return update_error;
- }
- printf("user pres %s succeeded. %zu\n", cmd_str, response_size);
- if (subcmd_size)
- return 0;
-
- if (response_size != sizeof(struct user_pres_response)) {
- fprintf(stderr, "Unexpected response %zu\n", response_size);
- return update_error;
- }
-
- printf("user pres %sabled\n",
- response.state & USER_PRES_ENABLE ? "en" : "dis");
- if (response.state & USER_PRES_PRESSED)
- printf("last press: %lu\n", response.last_press);
- return 0;
-}
-
-
-/*
* Enable or disable factory mode. Factory mode will only be enabled if HW
* write protect is removed.
*/
@@ -3102,7 +3048,6 @@ int main(int argc, char *argv[])
const char *openbox_desc_file = NULL;
int factory_mode = 0;
char *factory_mode_arg;
- char *user_pres_arg;
char *tpm_mode_arg = NULL;
char *serial = NULL;
int sn_bits = 0;
@@ -3111,7 +3056,6 @@ int main(int argc, char *argv[])
uint8_t sn_inc_rma_arg;
int erase_ap_ro_hash = 0;
int is_dauntless = 0;
- int user_pres = 0;
/*
* All options which result in setting a Boolean flag to True, along
@@ -3282,10 +3226,6 @@ int main(int argc, char *argv[])
fprintf(stderr, "Illegal wp option \"%s\"\n", optarg);
errorcnt++;
break;
- case 'z':
- user_pres = 1;
- user_pres_arg = optarg;
- break;
case 0: /* auto-handled option */
break;
case '?':
@@ -3340,7 +3280,6 @@ int main(int argc, char *argv[])
!openbox_desc_file &&
!tstamp &&
!tpm_mode &&
- !user_pres &&
(wp == WP_NONE)) {
if (optind >= argc) {
fprintf(stderr,
@@ -3422,9 +3361,6 @@ int main(int argc, char *argv[])
if (rma)
process_rma(&td, rma_auth_code);
- if (user_pres)
- exit(process_user_pres(&td, user_pres_arg));
-
if (factory_mode)
process_factory_mode(&td, factory_mode_arg);
if (wp != WP_NONE)