From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbcLFJRH (ORCPT ); Tue, 6 Dec 2016 04:17:07 -0500 Received: from 001b2d01.pphosted.com ([148.163.156.1]:39191 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752148AbcLFJRD (ORCPT ); Tue, 6 Dec 2016 04:17:03 -0500 Subject: Re: [tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd To: Jarkko Sakkinen , Tomas Winkler References: <1479895454-15076-1-git-send-email-tomas.winkler@intel.com> <1479895454-15076-2-git-send-email-tomas.winkler@intel.com> <20161203153236.jmulnrlvoitvjnhq@intel.com> Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org From: Nayna Date: Tue, 6 Dec 2016 14:46:43 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20161203153236.jmulnrlvoitvjnhq@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16120609-0044-0000-0000-000001F3255C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006203; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000194; SDB=6.00789974; UDB=6.00382513; IPR=6.00567713; BA=6.00004945; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013554; XFM=3.00000011; UTC=2016-12-06 09:17:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16120609-0045-0000-0000-0000061F3119 Message-Id: <584681FB.2070708@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-06_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612060159 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/03/2016 09:02 PM, Jarkko Sakkinen wrote: > On Wed, Nov 23, 2016 at 12:04:11PM +0200, Tomas Winkler wrote: >> Functions tpm_transmit and transmit_cmd are referenced >> from other functions kdoc hence deserve documentation. >> >> Signed-off-by: Tomas Winkler > > Do you mind if I change TPM_DIGEST_SIZE to SHA1_DIGEST_SIZE? > > I'm looking to drop TPM_DIGEST_SIZE eventually. I was thinking if we should use SHA1_DIGEST_SIZE directly from , or probably Thanks & Regards, - Nayna > > Reviewed-by: Jarkko Sakkinen > > /Jarkko > >> --- >> V2: Add some missing '.' >> drivers/char/tpm/tpm-interface.c | 33 ++++++++++++++++++++++++++++----- >> 1 file changed, 28 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c >> index a2688ac2b48f..769d8b0d31a3 100644 >> --- a/drivers/char/tpm/tpm-interface.c >> +++ b/drivers/char/tpm/tpm-interface.c >> @@ -328,8 +328,17 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, >> } >> EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); >> >> -/* >> - * Internal kernel interface to transmit TPM commands >> +/** >> + * tmp_transmit - Internal kernel interface to transmit TPM commands. >> + * >> + * @chip: TPM chip to use >> + * @buf: TPM command buffer >> + * @bufsiz: length of the TPM command buffer >> + * @flags: tpm transmit flags - bitmap >> + * >> + * Return: >> + * 0 when the operation is successful. >> + * A negative number for system errors (errno). >> */ >> ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz, >> unsigned int flags) >> @@ -409,9 +418,21 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz, >> return rc; >> } >> >> -#define TPM_DIGEST_SIZE 20 >> -#define TPM_RET_CODE_IDX 6 >> - >> +/** >> + * tmp_transmit_cmd - send a tpm command to the device >> + * The function extracts tpm out header return code >> + * >> + * @chip: TPM chip to use >> + * @cmd: TPM command buffer >> + * @len: length of the TPM command >> + * @flags: tpm transmit flags - bitmap >> + * @desc: command description used in the error message >> + * >> + * Return: >> + * 0 when the operation is successful. >> + * A negative number for system errors (errno). >> + * A positive number for a TPM error. >> + */ >> ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd, >> int len, unsigned int flags, const char *desc) >> { >> @@ -434,6 +455,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd, >> return err; >> } >> >> +#define TPM_DIGEST_SIZE 20 >> +#define TPM_RET_CODE_IDX 6 >> #define TPM_INTERNAL_RESULT_SIZE 200 >> #define TPM_ORD_GET_CAP cpu_to_be32(101) >> #define TPM_ORD_GET_RANDOM cpu_to_be32(70) >> -- >> 2.7.4 >> > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > tpmdd-devel mailing list > tpmdd-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tpmdd-devel >