From patchwork Thu Mar 30 12:08:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Hao" X-Patchwork-Id: 9654049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FB2F6034C for ; Thu, 30 Mar 2017 12:16:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FCA02858F for ; Thu, 30 Mar 2017 12:16:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44A7E28592; Thu, 30 Mar 2017 12:16:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECF392858F for ; Thu, 30 Mar 2017 12:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933843AbdC3MQT (ORCPT ); Thu, 30 Mar 2017 08:16:19 -0400 Received: from mga11.intel.com ([192.55.52.93]:26170 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933835AbdC3MQS (ORCPT ); Thu, 30 Mar 2017 08:16:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490876177; x=1522412177; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=+tzmLfaKBFgIVbXpd7DNxj1Rm+4wIlYXnVdrCexoTEg=; b=LrGQU0G8mf8/5Xitxx3vH9s6Fe65tBApwKUdV7igs4R4UdO7fgZV+qpl ga4GrDu588rL6YRyUZYLY7K6yC+nPA==; Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2017 05:16:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,246,1486454400"; d="scan'208";a="840018371" Received: from hao-dev.bj.intel.com ([10.238.157.61]) by FMSMGA003.fm.intel.com with ESMTP; 30 Mar 2017 05:16:09 -0700 From: Wu Hao To: atull@kernel.org, moritz.fischer@ettus.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: 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 14/16] fpga: intel: afu add FPGA_GET_API_VERSION/CHECK_EXTENSION ioctls support Date: Thu, 30 Mar 2017 20:08:14 +0800 Message-Id: <1490875696-15145-15-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490875696-15145-1-git-send-email-hao.wu@intel.com> References: <1490875696-15145-1-git-send-email-hao.wu@intel.com> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FPGA_GET_API_VERSION and 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 Intel 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 --- drivers/fpga/intel/afu-main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/fpga/intel/afu-main.c b/drivers/fpga/intel/afu-main.c index 7166d5c..89d4b2f 100644 --- a/drivers/fpga/intel/afu-main.c +++ b/drivers/fpga/intel/afu-main.c @@ -124,6 +124,13 @@ static int afu_release(struct inode *inode, struct file *filp) return 0; } +static long afu_ioctl_check_extension(struct 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; @@ -134,6 +141,10 @@ static long afu_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) dev_dbg(&pdev->dev, "%s cmd 0x%x\n", __func__, cmd); switch (cmd) { + case FPGA_GET_API_VERSION: + return FPGA_API_VERSION; + case FPGA_CHECK_EXTENSION: + return afu_ioctl_check_extension(pdata, arg); default: /* * Let sub-feature's ioctl function to handle the cmd