From b78cbbfd27470abdd588f6d17670a30dbe63db01 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Tue, 1 Mar 2022 12:49:05 -0600 Subject: ccd_config: allow the option to restrict ccd in prepvt images By default ccd open can be sent from the console in normal mode with prepvt images. The open capabilities are set to Always which should determine that open is allowed, but prepvt images completely ignore the ccd settings. This change modifies the CCD_OPEN_PREPVT behavior to honor the capabilities, so someone could restrict ccd open in prepvt images with the ccd capability settings. BUG=b:221260041 TEST=manual see bug Change-Id: I1c3fc4f5be27a08ea9071966cc01c4b9ff20dbe5 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3498700 Reviewed-by: Vadim Sukhomlinov --- common/ccd_config.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/ccd_config.c b/common/ccd_config.c index 7d430cb797..684a747f8a 100644 --- a/common/ccd_config.c +++ b/common/ccd_config.c @@ -963,14 +963,12 @@ static enum vendor_cmd_rc ccd_open(struct vendor_cmd_params *p) * console. Reject both unless CCD_CAP_OPEN_FROM_USB is enabled. */ } else { -#ifndef CONFIG_CCD_OPEN_PREPVT /* * - Battery is present * - Either not in developer mode or the command came from USB */ why_denied = "open from AP in devmode or remove batt"; goto denied; -#endif } /* Fail and abort if already checking physical presence */ -- cgit v1.2.1