From patchwork Mon Jul 24 12:04:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gupta, Nipun" X-Patchwork-Id: 124915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1772274vqg; Mon, 24 Jul 2023 05:42:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlEC49zTiiHZekjyzcqGlYyNfNesJi8UUJ3hDoD9qEUWDEzSC4yfYhbQ18gUuAl+hEVdKxl/ X-Received: by 2002:a05:6a20:3955:b0:135:6ef6:171 with SMTP id r21-20020a056a20395500b001356ef60171mr13834925pzg.39.1690202542086; Mon, 24 Jul 2023 05:42:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690202542; cv=pass; d=google.com; s=arc-20160816; b=XJiipn94dgvNF3JbZzm6oByPzsteqqYBQmr/3sG9Ko6til8HEjYoHvL7jox/BiwdCW iRs9G05V5e+FbhRewAG/SuMaYEoA/VKZ4SR1McS6PXEVi9QqIUXdPwMvBR9YWOE3JhUE bonYAOe+oY+TIlGOxjrwSV+6KlVA2PxzgI7vX5G/ppnv8KKq1VB829rcZH29hSQJykvI 2loksD4iGTzQArn7AXAkOax2aCFhSX3b65RLw5M8uNU6qXdux4006kBPlo/wR+wJCDXp gmaj1BwL2aq510aV7HvIX2SY94VxC4jt+XyroVPD3ZvI3mwWt8/V/L0K5lNJDS7OvOCO wBfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=cOqBUnirZoRWiDgYqzn7wAF4ngZGrzB7sn02TwVKG9s=; fh=IEPOxFh5sAhUyhL9fzRJcS4jRyTgojUFJqS7qbtfFRY=; b=l7Sd9l5taI9nJKDoQmLoRfhEsuq905IXWKezxFwPaDs1f58LsqsvXC2jt0hA/PQo+6 mkR1SkL1HiXyZJoym9popPxyHXeDJaCZxjjq5J7kRP/M1Ch27FjnAulxWdGQAJ1+wJY3 kb+1c0GYIgO8naFPS05zCOKyfX402N5IEeUdx/kuYhrQoSECbx1hagZ1IqUN/48VJf0N BZNkOfR+gEEmHVmD6d9KiJ78tdARAMlxUFcjUL0gc168ibJ/zrXkTBd4XVZU2dSTSxKM 8j63DNtvY/uhHWdDNtDFTSoIgbOl6OO822KuerTi92U/JC/4NHBdh3hgSd4XsyCn10EF DhQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GFF9eth0; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d71-20020a63364a000000b0056357813fc2si8434248pga.183.2023.07.24.05.42.05; Mon, 24 Jul 2023 05:42:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GFF9eth0; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjGXMFS (ORCPT + 99 others); Mon, 24 Jul 2023 08:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjGXMFP (ORCPT ); Mon, 24 Jul 2023 08:05:15 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F01F10EB for ; Mon, 24 Jul 2023 05:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kzni/4aPXesM/r+NVGGjk8GWn1sUgitr6dwj7OpVAv8mAHRea5y5GBP6gzphZJvwlf+SMZddDgpGJjPLK7KaG0kyMrEgQxw6IwdhgBAwcFwW2V809zzdtD8F8ORuRbaYJ8ILBGthXFHKpErFxraW3jxp0go2lRN0NR8s9xpzaNN6iQTebzBivcFwvwqPAryYeY55orhKzKjyDTyN5aRKo+f5MDvU6tAmNS2h3McJJoCOSr9HVEhYfgzUAtKws2BIZHPLYlmA8MZhh2JLOJeKNiTD0NJPkYgjT70/AlQTF5jsp8uA+t3xvoWwsWliBxLopeBkg1u0aQRW1qkgkze1SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cOqBUnirZoRWiDgYqzn7wAF4ngZGrzB7sn02TwVKG9s=; b=KdqT748tO5HCpYfy4isgJ6ZyLd9g9THearJ49vN0gcy/F5mFfY4SHB80mmW016+NtjBLbTPNwQAI3uAAgSdnZtCMa1m7HmwTSf1uYnG6/wA30mfapo7Jd1cl3H5jTVsXfAwpwovDBcI86LqTCXSIm7nfGqcCuvyy8IVu3v1zcYxfaPCY2X5XU/h4TqWe9CbHPtqptcg4Y+gJ3E8LhXbOGf50sX0WpSeE9t6ibbKAcIpj0ajkam2ocjLd9gMRAOuStQ9OIG2jE3n9+wvRlSFDwLlc6DqZbGxo+WyhF2oj1VQdHkgbIq0s8OkmZXRlvo9ppvK1nhkfy67p7BcNpdBEmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cOqBUnirZoRWiDgYqzn7wAF4ngZGrzB7sn02TwVKG9s=; b=GFF9eth0lHxr4+TrbJSDgcB4rqf1DoXLx0PzP3Nrxo28nszkw2yHxxRQ784hQMfBPKVBG4zBE/qhXQiw5avE//6w9uWgJVghp9LJyqxJrHkWIMbd0UqZFm+u5gF0UvjRDRZhVb08fKnIXpHsWZ3vG6gGBE5a/AMrdoAFZ7dmEjo= Received: from MW4PR04CA0171.namprd04.prod.outlook.com (2603:10b6:303:85::26) by SN7PR12MB7022.namprd12.prod.outlook.com (2603:10b6:806:261::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul 2023 12:05:05 +0000 Received: from CO1NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:303:85:cafe::41) by MW4PR04CA0171.outlook.office365.com (2603:10b6:303:85::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32 via Frontend Transport; Mon, 24 Jul 2023 12:05:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT030.mail.protection.outlook.com (10.13.174.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.25 via Frontend Transport; Mon, 24 Jul 2023 12:05:04 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 07:05:02 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 05:04:44 -0700 Received: from xhdipdslab41.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 24 Jul 2023 07:04:42 -0500 From: Nipun Gupta To: , CC: , , , , , Nipun Gupta Subject: [PATCH v3] cdx: add support for bus mastering Date: Mon, 24 Jul 2023 17:34:33 +0530 Message-ID: <20230724120433.15910-1-nipun.gupta@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT030:EE_|SN7PR12MB7022:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bfc7e46-b545-47b2-ff5c-08db8c3e378a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PPioAtjZ6bgO9SeFoWCPXPVpkWh/av1bVthyMPXazLhUU9DYkzj2cFNpXQln9VhcouSh1VZZZ90TqfOkcrCUtfJHnaQPRzyg/9V+mOHfjLS96qUOKMp6fJHeatTv+A+//3aoSUqrCOcRWzIJQtgC/Sx4rORUaDe7kMBGshimdiLKBkyBz78dRYFqXDpW0XttTo0isF7BEx1ibzUCgTRWkSuVF+ILtGm5OijsdhVQF4G2N2hpe+8q53oA367CWdRf7uyxn2egIPElxD690x75YqdVhwE0Gxw9/TOEUAaOpUSc/FFI4MJrcqqNBw0j9Xguo1vOu8syIp0jI5w4ahHckrRKmpy3Du+IwC7HrDu87COZ3rN6kAzp9V+01r7U1q97v1Z5E0PoNUcDPotP1GiGy+E74VorADJgUhqaE31Fc3JzVGuGZPrTR+DMlcoiwrLtGX1ccjHcpt9O4Xgy64tXWkr2sphAEXKEDPbBXTbedHYbJhHEtzK2gGbm8TwW58i2XqBNDUC0PiaKom95ChSElFLK1Gh4rqBX9kuukbsx+ebx3tt0se9PwN22I311pIeHcxHK8cDUUMxVnykxvfHGinfJxMnkwmqgXwAo1Wi4RnPwXvTl/ZSucryKYAZWaYLrYBqJsZsE1A0fN+Ms/uUsejDv2Jg7SpHtJ2SI4GLSkWMQfyqLuP87FHrmj8naMg6NuQ3NnP0+vnW5oCCBdC6s/bLTZ0VqnO5b7WxYa+dvHMGaK3DRWqmo5eVwnkeSmpbufYwT5Sh/BwSgRqPlUgozBw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(5660300002)(8676002)(44832011)(8936002)(316002)(41300700001)(478600001)(2906002)(54906003)(110136005)(6666004)(1076003)(336012)(186003)(26005)(47076005)(2616005)(426003)(4326008)(70586007)(70206006)(83380400001)(36860700001)(356005)(36756003)(40480700001)(81166007)(40460700003)(86362001)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 12:05:04.9368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bfc7e46-b545-47b2-ff5c-08db8c3e378a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7022 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772305514220583834 X-GMAIL-MSGID: 1772305820499391203 Introduce cdx_set_master() and cdx_clear_master() APIs to support enable and disable of bus mastering. Drivers need to use these APIs to enable/disable DMAs from the CDX devices. Signed-off-by: Nipun Gupta Reviewed-by: Pieter Jansen van Vuuren --- Changes v2->v3 - Changed return value from EOPNOTSUPP to -EOPNOTSUPP in cdx_set_master() Changes v1->v2: - Replace bme with bus_master_enable - Added check for dev_configure API callback - remove un-necessary error prints - changed conditional to if-else - updated commit message to use 72 columns drivers/cdx/cdx.c | 29 +++++++++++++ drivers/cdx/controller/cdx_controller.c | 4 ++ drivers/cdx/controller/mcdi_functions.c | 58 +++++++++++++++++++++++++ drivers/cdx/controller/mcdi_functions.h | 13 ++++++ include/linux/cdx/cdx_bus.h | 16 +++++++ 5 files changed, 120 insertions(+) diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c index d2cad4c670a0..71ddb56a5d08 100644 --- a/drivers/cdx/cdx.c +++ b/drivers/cdx/cdx.c @@ -182,6 +182,35 @@ cdx_match_id(const struct cdx_device_id *ids, struct cdx_device *dev) return NULL; } +int cdx_set_master(struct cdx_device *cdx_dev) +{ + struct cdx_controller *cdx = cdx_dev->cdx; + struct cdx_device_config dev_config; + int ret = -EOPNOTSUPP; + + dev_config.type = CDX_DEV_BUS_MASTER_CONF; + dev_config.bus_master_enable = true; + if (cdx->ops->dev_configure) + ret = cdx->ops->dev_configure(cdx, cdx_dev->bus_num, + cdx_dev->dev_num, &dev_config); + + return ret; +} +EXPORT_SYMBOL_GPL(cdx_set_master); + +void cdx_clear_master(struct cdx_device *cdx_dev) +{ + struct cdx_controller *cdx = cdx_dev->cdx; + struct cdx_device_config dev_config; + + dev_config.type = CDX_DEV_BUS_MASTER_CONF; + dev_config.bus_master_enable = false; + if (cdx->ops->dev_configure) + cdx->ops->dev_configure(cdx, cdx_dev->bus_num, + cdx_dev->dev_num, &dev_config); +} +EXPORT_SYMBOL_GPL(cdx_clear_master); + /** * cdx_bus_match - device to driver matching callback * @dev: the cdx device to match against diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c index dc52f95f8978..39aa569d8e07 100644 --- a/drivers/cdx/controller/cdx_controller.c +++ b/drivers/cdx/controller/cdx_controller.c @@ -55,6 +55,10 @@ static int cdx_configure_device(struct cdx_controller *cdx, case CDX_DEV_RESET_CONF: ret = cdx_mcdi_reset_device(cdx->priv, bus_num, dev_num); break; + case CDX_DEV_BUS_MASTER_CONF: + ret = cdx_mcdi_bus_master_enable(cdx->priv, bus_num, dev_num, + dev_config->bus_master_enable); + break; default: ret = -EINVAL; } diff --git a/drivers/cdx/controller/mcdi_functions.c b/drivers/cdx/controller/mcdi_functions.c index 0158f26533dd..6acd8fea4586 100644 --- a/drivers/cdx/controller/mcdi_functions.c +++ b/drivers/cdx/controller/mcdi_functions.c @@ -137,3 +137,61 @@ int cdx_mcdi_reset_device(struct cdx_mcdi *cdx, u8 bus_num, u8 dev_num) return ret; } + +static int cdx_mcdi_ctrl_flag_get(struct cdx_mcdi *cdx, u8 bus_num, + u8 dev_num, u32 *flags) +{ + MCDI_DECLARE_BUF(inbuf, MC_CMD_CDX_DEVICE_CONTROL_GET_IN_LEN); + MCDI_DECLARE_BUF(outbuf, MC_CMD_CDX_DEVICE_CONTROL_GET_OUT_LEN); + size_t outlen; + int ret; + + MCDI_SET_DWORD(inbuf, CDX_DEVICE_CONTROL_GET_IN_BUS, bus_num); + MCDI_SET_DWORD(inbuf, CDX_DEVICE_CONTROL_GET_IN_DEVICE, dev_num); + ret = cdx_mcdi_rpc(cdx, MC_CMD_CDX_DEVICE_CONTROL_GET, inbuf, + sizeof(inbuf), outbuf, sizeof(outbuf), &outlen); + if (ret) + return ret; + + if (outlen != MC_CMD_CDX_DEVICE_CONTROL_GET_OUT_LEN) + return -EIO; + + *flags = MCDI_DWORD(outbuf, CDX_DEVICE_CONTROL_GET_OUT_FLAGS); + + return 0; +} + +static int cdx_mcdi_ctrl_flag_set(struct cdx_mcdi *cdx, u8 bus_num, + u8 dev_num, bool enable, int lbn) +{ + MCDI_DECLARE_BUF(inbuf, MC_CMD_CDX_DEVICE_CONTROL_SET_IN_LEN); + u32 flags; + int ret; + + /* + * Get flags and then set/reset BUS_MASTER_BIT according to + * the input params. + */ + ret = cdx_mcdi_ctrl_flag_get(cdx, bus_num, dev_num, &flags); + if (ret) + return ret; + + flags = flags & (u32)(~(BIT(lbn))); + if (enable) + flags |= (1 << lbn); + + MCDI_SET_DWORD(inbuf, CDX_DEVICE_CONTROL_SET_IN_BUS, bus_num); + MCDI_SET_DWORD(inbuf, CDX_DEVICE_CONTROL_SET_IN_DEVICE, dev_num); + MCDI_SET_DWORD(inbuf, CDX_DEVICE_CONTROL_SET_IN_FLAGS, flags); + ret = cdx_mcdi_rpc(cdx, MC_CMD_CDX_DEVICE_CONTROL_SET, inbuf, + sizeof(inbuf), NULL, 0, NULL); + + return ret; +} + +int cdx_mcdi_bus_master_enable(struct cdx_mcdi *cdx, u8 bus_num, + u8 dev_num, bool enable) +{ + return cdx_mcdi_ctrl_flag_set(cdx, bus_num, dev_num, enable, + MC_CMD_CDX_DEVICE_CONTROL_SET_IN_BUS_MASTER_ENABLE_LBN); +} diff --git a/drivers/cdx/controller/mcdi_functions.h b/drivers/cdx/controller/mcdi_functions.h index 7440ace5539a..a448d6581eb4 100644 --- a/drivers/cdx/controller/mcdi_functions.h +++ b/drivers/cdx/controller/mcdi_functions.h @@ -58,4 +58,17 @@ int cdx_mcdi_get_dev_config(struct cdx_mcdi *cdx, int cdx_mcdi_reset_device(struct cdx_mcdi *cdx, u8 bus_num, u8 dev_num); +/** + * cdx_mcdi_bus_master_enable - Set/Reset bus mastering for cdx device + * represented by bus_num:dev_num + * @cdx: pointer to MCDI interface. + * @bus_num: Bus number. + * @dev_num: Device number. + * @enable: Enable bus mastering if set, disable otherwise. + * + * Return: 0 on success, <0 on failure + */ +int cdx_mcdi_bus_master_enable(struct cdx_mcdi *cdx, u8 bus_num, + u8 dev_num, bool enable); + #endif /* CDX_MCDI_FUNCTIONS_H */ diff --git a/include/linux/cdx/cdx_bus.h b/include/linux/cdx/cdx_bus.h index bead71b7bc73..1816c279879e 100644 --- a/include/linux/cdx/cdx_bus.h +++ b/include/linux/cdx/cdx_bus.h @@ -21,11 +21,13 @@ struct cdx_controller; enum { + CDX_DEV_BUS_MASTER_CONF, CDX_DEV_RESET_CONF, }; struct cdx_device_config { u8 type; + bool bus_master_enable; }; typedef int (*cdx_scan_cb)(struct cdx_controller *cdx); @@ -170,4 +172,18 @@ extern struct bus_type cdx_bus_type; */ int cdx_dev_reset(struct device *dev); +/** + * cdx_set_master - enables bus-mastering for CDX device + * @cdx_dev: the CDX device to enable + * + * Return: 0 for success, -errno on failure + */ +int cdx_set_master(struct cdx_device *cdx_dev); + +/** + * cdx_clear_master - disables bus-mastering for CDX device + * @cdx_dev: the CDX device to disable + */ +void cdx_clear_master(struct cdx_device *cdx_dev); + #endif /* _CDX_BUS_H_ */