Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbcLFMMp convert rfc822-to-8bit (ORCPT ); Tue, 6 Dec 2016 07:12:45 -0500 Received: from mga02.intel.com ([134.134.136.20]:16313 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbcLFMMl (ORCPT ); Tue, 6 Dec 2016 07:12:41 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="39501659" From: "Winkler, Tomas" To: Nayna , Jarkko Sakkinen CC: "tpmdd-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Subject: RE: [tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Thread-Topic: [tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Thread-Index: AQHST6GOGSeqo/QFx0uAKBg/lrtWiKD61DDQ Date: Tue, 6 Dec 2016 12:11:08 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B543378A2@hasmsx108.ger.corp.intel.com> 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> <584681FB.2070708@linux.vnet.ibm.com> In-Reply-To: <584681FB.2070708@linux.vnet.ibm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTRjNjdkMjAtODJlMC00NWIyLWE5MTEtMTE2MWUzM2NkYWFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlgxcUNua3YzSlFsTllxYU4zZlU2TTdleXJMVE5wZ2g4Vk5rQlwvUHR2ZzlrPSJ9 x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3875 Lines: 115 > -----Original Message----- > From: Nayna [mailto:nayna@linux.vnet.ibm.com] > Sent: Tuesday, December 06, 2016 11:17 > To: Jarkko Sakkinen ; Winkler, Tomas > > Cc: tpmdd-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org > Subject: Re: [tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and > tpm_transmit_cmd > > > > 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 Probably the best approach Tomas > > > > > 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 > >