Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1404329imm; Fri, 29 Jun 2018 18:09:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLeABE7jAV3TWOMZc1Ve/F/mxFuH2NMEF5GLEP7/O4EXXOpUJ2sRwZUVyUOax70P2VIRSgS X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr17194267plh.291.1530320983072; Fri, 29 Jun 2018 18:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530320983; cv=none; d=google.com; s=arc-20160816; b=Ul8aWC2Q5rzyQKXgpbAamXHzcCm3gGRZHsNYV2/bfl7aAxOWQiO+W6PISnveJt2szF n56zJ9qOk8sqPiKVF5looGr3gJ2va3dRUMB1tzddhjnP1LAtBH9Z+NworMwRHucWZSoA hCSFwVPU2CosAhfPGa4byEGgiR7o0dLoIf36oosK3wSnxk3YD6REepq63pyiJJmsW1Dx QOqnM0m3n/nC/Ms6J2G50D7mGU+V3AAtNYc8uxQowwafiRMKJJMM+aA0ohdkv9wlnaYL 9fHlQOUw8Jzjotz6SQ1G+tfoq5b+zqqpzWTAgIOrplIvjceusnGhgzr0EJ0l7b0MlsCi dQYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ar1TBjMIT4zLJ3kEPLLYT2T5jDyFmsoi1nVAYeooSVY=; b=cHufdp/FCfYsGSBfZCjq20WUjtQJNsNA6fOHYjUIN2jwS2QGMAfI75PiEOgJRiqBTH cVskyRusKipVphFxJHO7PVZWkhRFxHAUdkkuPrRV46zn4hcr1HsTc3Z2XmAuuetvewIs rXDEgBYSSZiojLvwVx9xorgvnzixXSRlP3We6BFvp7pHtPUmPz1vdxUoyGVZ+J3rAo9o Ybz979hV84cpNYhoPlfb48Uq9c6nG6jL7Oe1Df1rHG1gQ0EaI9ett+Jk6qQP6RbrgU0m pUHsK0eXCecyerENmYCsfEY8kg6Ee5KtY73q1xggLk+DYy/xrax/e8wohLwax1ZUJumL IGxA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u73-v6si10818064pfk.82.2018.06.29.18.09.29; Fri, 29 Jun 2018 18:09:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966039AbeF3BHK (ORCPT + 99 others); Fri, 29 Jun 2018 21:07:10 -0400 Received: from mga11.intel.com ([192.55.52.93]:26625 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933497AbeF3BHF (ORCPT ); Fri, 29 Jun 2018 21:07:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 18:07:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,288,1526367600"; d="scan'208";a="212317475" Received: from hao-dev.bj.intel.com ([10.238.157.61]) by orsmga004.jf.intel.com with ESMTP; 29 Jun 2018 18:07:02 -0700 From: Wu Hao To: atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, luwei.kang@intel.com, yi.z.zhang@intel.com, hao.wu@intel.com, Tim Whisonant , Enno Luebbers , Shiva Rao , Christopher Rauer , Xiao Guangrong Subject: [PATCH v7 26/29] fpga: dfl: afu: add DFL_FPGA_GET_API_VERSION/CHECK_EXTENSION ioctls support Date: Sat, 30 Jun 2018 08:53:33 +0800 Message-Id: <1530320016-24712-27-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530320016-24712-1-git-send-email-hao.wu@intel.com> References: <1530320016-24712-1-git-send-email-hao.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DFL_FPGA_GET_API_VERSION and DFL_FPGA_CHECK_EXTENSION ioctls are common ones which need to be supported by all feature devices drivers including FME and AFU. This patch implements above 2 ioctls in FPGA Accelerated Function Unit (AFU) driver. Signed-off-by: Tim Whisonant Signed-off-by: Enno Luebbers Signed-off-by: Shiva Rao Signed-off-by: Christopher Rauer Signed-off-by: Xiao Guangrong Signed-off-by: Wu Hao Acked-by: Alan Tull Acked-by: Moritz Fischer --- v2: rebased v3: rebased as driver renamed to fpga-dfl-afu fix one checkpatch issue v4: add Acked-by from Alan and Moritz. v5: rebase and add DFL_ prefix to APIs. v6: rebase. --- drivers/fpga/dfl-afu-main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c index d36b3e9..4074b97 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -236,6 +236,13 @@ static int afu_release(struct inode *inode, struct file *filp) return 0; } +static long afu_ioctl_check_extension(struct dfl_feature_platform_data *pdata, + unsigned long arg) +{ + /* No extension support for now */ + return 0; +} + static long afu_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct platform_device *pdev = filp->private_data; @@ -248,6 +255,10 @@ static long afu_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) pdata = dev_get_platdata(&pdev->dev); switch (cmd) { + case DFL_FPGA_GET_API_VERSION: + return DFL_FPGA_API_VERSION; + case DFL_FPGA_CHECK_EXTENSION: + return afu_ioctl_check_extension(pdata, arg); default: /* * Let sub-feature's ioctl function to handle the cmd -- 1.8.3.1