Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2108848imm; Mon, 28 May 2018 01:40:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrpd8fyn2BIdqkZdihiIHi83iSP0bEeUpfZw8qcqOaxm9iMlx/w2Dwl5IOQxmI336/JPars X-Received: by 2002:a63:798d:: with SMTP id u135-v6mr9584592pgc.401.1527496827010; Mon, 28 May 2018 01:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527496826; cv=none; d=google.com; s=arc-20160816; b=F7ngH3XHiXfrE/3/M2O3eRPRJxoNqMWBJunYEDeEGuJbgGUMTuvKez7yGAclcUh/tE GxLjJ00Qg22aOBzgTRcS9Z09N68+RXuZcyXerYCpaHlnIW3vRB5JzJdl3hCJrfmAVM9f Guw2Pxf76B2Cmq/ECkzIhjoNSXhc8DduByLJJqyk+yZbI/8901ZGqkFy/Xr66QEmUYLn SP/mC4Tqs9xfBb9gdsjDSDJpwcZOtnFJ8+Ba8zgKib6PmYxqg6PRiR6foNyPkoWXaAFp 0LD8oLfYopOTvH2skVXkk4XX3nDLs7uYV6YItzfHlsnJjnM0BxLezlhAw+izZKFWLqBl YEeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=PelMXdusff+/pzS8PyzODwGurV+w+77Lgxs/Est17S8=; b=Njjn4UPkv/Q3elGV94BWNM7+RSQLSQrj85LLwu5OMbB7ccqX1D9ZDUrVPgBoLQTv4G JS6DbFs6P32+1zZghaYNldUQ2tf0TsQt0TOOtpr6SOlKJ3kuwZo2yP6XXxRrJeUs/6sK LdsqfNZJ6eaox2NH4k8Hhy8v9NVbQ8zlyQ0E+x1x448XXfk0hb36A8IxX+93qiM48H/6 SYb80sdLo1nZ85rEBUQZaBBnEK8uRZBXKk6KY++3u26mj7d/iXXh5/9UGHzOL8mnrc+6 kwBfT74Oi+XHg7ubJ3WjhjH6gZj5kBM6GDA5ftAdhKVO2uiu6TM959MoLz/yAaCIl0Q/ FEsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UO3sVKyK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15-v6si821631pfc.320.2018.05.28.01.40.11; Mon, 28 May 2018 01:40:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UO3sVKyK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754082AbeE1Iit (ORCPT + 99 others); Mon, 28 May 2018 04:38:49 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53264 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbeE1Iil (ORCPT ); Mon, 28 May 2018 04:38:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id a67-v6so29892130wmf.3; Mon, 28 May 2018 01:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PelMXdusff+/pzS8PyzODwGurV+w+77Lgxs/Est17S8=; b=UO3sVKyKZnSt+B3TRyW24cRnHeqgtM7N2canD4AEKZnRlczTHN0oMcm4IXHNaGemux kaELG14V1rBzh5w8UpW6SQMhNgw6zaAVrWvExGCxkVqUurdPNRZ2htIhBCEu8Q802Kdw GrJAw3xH+XSPyyrESK13k89NPxLOQBzpSLj+ns38B65C6+wkzrf9pmxzkbTRhlu5co5a Yd8xjYT7s/BqEaAfKYv2kOPFduuzJbB9zrHWEq8sspIf7TnCmVTJ3PaoSJ5/RwVCEPGV q05k4CjKdzpPzY6xO/zCsNGWanv+ZMIqeDjEUoU7Slh5AQ6OgLUFrBamPAkQ6yUwpuHt mFEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=PelMXdusff+/pzS8PyzODwGurV+w+77Lgxs/Est17S8=; b=Gql8RBvrMy81MX1eMqXRt+nsM8Hu7k6Y3pO4X5WcKXOKgZupqT6fN7CwTmOCgzycJB i901AkQj+cP/M0gMXLA0bWbx40ZGUqH3pEsEhmidga+Zsn44Kbd3bnF4x3+9a1ObUXzI iHOOX0jw56cZeQjI12GxqyeTPCPDy2wIlMxpvUOyNbUtl6sYy6gTx6Rkp5vo/nVWXHqa bSioho61lFel9ga41c7xBCtUQIp7NkDVSqHztvjg/49myTUnzKmNS0vum8VXLRm9FWyN cOPDhmiV9p2aMDfHZY4aIc6aprT3XqXpnDTzfY91RcU9GZA1IAufSEfNR+uHX7HcE8Rb 5vJg== X-Gm-Message-State: ALKqPweEB1NgVzVnaBYj6DoH33/+tuMHwd5DEvgQXfN8kfv5vpe1KRyp gcAcXXrz3vSdkWwQEpaXcl8= X-Received: by 2002:a2e:7c02:: with SMTP id x2-v6mr7883089ljc.96.1527496720076; Mon, 28 May 2018 01:38:40 -0700 (PDT) Received: from gmail.com (c-5eea3441-74736162.cust.telenor.se. [94.234.52.65]) by smtp.gmail.com with ESMTPSA id r15-v6sm5814071ljh.6.2018.05.28.01.38.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 May 2018 01:38:39 -0700 (PDT) Date: Mon, 28 May 2018 10:38:34 +0200 From: Marcus Folkesson To: Andrzej Pietrasiewicz Cc: Greg Kroah-Hartman , Jonathan Corbet , Felipe Balbi , davem@davemloft.net, Mauro Carvalho Chehab , Andrew Morton , Randy Dunlap , Ruslan Bilovol , Thomas Gleixner , Kate Stewart , linux-usb@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] usb: gadget: ccid: add support for USB CCID Gadget Device Message-ID: <20180528083834.GB4651@gmail.com> References: <20180526211940.25474-1-marcus.folkesson@gmail.com> <20180528070453eucas1p294be19abd2cab7d112404d15710edfde~yvQ5mevbz2769227692eucas1p2k@eucas1p2.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180528070453eucas1p294be19abd2cab7d112404d15710edfde~yvQ5mevbz2769227692eucas1p2k@eucas1p2.samsung.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrzej, On Mon, May 28, 2018 at 09:04:51AM +0200, Andrzej Pietrasiewicz wrote: > Mi Marcus, > > W dniu 26.05.2018 o?23:19, Marcus Folkesson pisze: > > Chip Card Interface Device (CCID) protocol is a USB protocol that > > allows a smartcard device to be connected to a computer via a card > > reader using a standard USB interface, without the need for each manufacturer > > of smartcards to provide its own reader or protocol. > > > > This gadget driver makes Linux show up as a CCID device to the host and let a > > userspace daemon act as the smartcard. > > > > This is useful when the Linux gadget itself should act as a cryptographic > > device or forward APDUs to an embedded smartcard device. > > > > Signed-off-by: Marcus Folkesson > > --- > > > > > +config USB_CONFIGFS_CCID > > + bool "Chip Card Interface Device (CCID)" > > + depends on USB_CONFIGFS > > + select USB_F_CCID > > + help > > + The CCID function driver provides generic emulation of a > > + Chip Card Interface Device (CCID). > > + > > + You will need a user space server talking to /dev/ccidg*, > > + since the kernel itself does not implement CCID/TPDU/APDU > > + protocol. > > Your function needs a userspace daemon to work. > It seems you want to use FunctionFS for such a purpose > instead of creating a new function. > > Andrzej > > + since the kernel itself does not implement CCID/TPDU/APDU Oops, the driver does handle CCID. Well, yes, It needs an application that perform the "smartcard operations", such as generate keys or sign data, as this depends on how it should be used. The actual smartcard operations could for example be in software, use a crypto engine in SoC or external HSM (Hardware Security Module). Without the application, the gadget shows up as a smart card reader with an unconnected smartcard. I guess it could be accomplished with FunctionFS as well. Best regards Marcus Folkesson