From patchwork Tue Jun 28 22:13:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12899097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BC7DC43334 for ; Tue, 28 Jun 2022 22:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Dg4de4dNqrybn0p61S/PQmlXrGHJpGAaAM/snchRCzA=; b=I/pICKD/tW9QOU bypKCVcga7j4345SKeOOXvIbJUH5qXpThEvgm8N+PolLH56YKUh4wtlHwwiC58+3OUnq3BVts43U2 +wigMiI7vMoEw6IxtjDYp+4aqCIDrR1pXz+2AFsOONPj+/GsZPye20SpV775hYN69AGRSI9u4yg8E /wjAuxJp8ZsF8akDNUNqYxH7JPm12ZUqWsNw0as8GzT9yr0vZVkW4FL3KPhKSKDI/Ekr1z2KK+49L PXSs3uPHpGKtWf+11WVfYsLlfprlj876k++i28xVLf1Afiaqf7fLZMd0TgjvgLfgmrgTkr7pDXPhb XpAvlApeF4vvKkZ+rGHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6JpP-008Sno-4L; Tue, 28 Jun 2022 22:37:06 +0000 Received: from mail-eopbgr80074.outbound.protection.outlook.com ([40.107.8.74] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6JU8-008MXM-UV for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 22:15:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bbzhtgffuWa57dQpymGFlDvPtwqVJ50Qm68fFMmlliSeUCrOLyp3xZbaarIhAh8DGjNhXzHL6768RZkfvrreKEKq1QJ9TTCrlWCPkQ7ZYESNpVkcD+8a31O+tPl11pjGyzwn1TwwSlLMP7NZPFMeE+MZMnrrhEqb74Ff7C42b895GHlM0z+4aBHkv/wt/1K95Ek3xke4ar0tyHFrHDeClLhhjiq1nZUp9qX4s8O2mT3QIqKOJvJtxsumaYnBcgMahfOT+3gsboZtdd/xyIA9nr+8Yzy3g6c3nHv2a6XBhGDdil7F1abpF0ba6ZdJtKvEIvY67sKYhaUiU6bs0Vwyqw== 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=n7BrJA5PavkzVyK1KGe8HWlNKAyaHV7WuMzVn0YbMoY=; b=XOX8PZ4gnwFb7q91XhxhZh4EoavvW5KCn5aWQLTAxKFAO9fdHgbIRWLnhr8YVvNLer4RFQK1Rvi4TgTLPAIVZVIsXM1sVSiYuo+dKyNo2Gk7JoxMusgAOVReZny5atuI0mHQJU5bQQ37+m4ewG+p4w4YyRGJR9vvPemwul2OPfXNR9o0bgQBCWF1cbTAUWy/FPDGTzEFkt87h0FNYbBwEdWDO/s51uvVhkk9gB9BV1vpYEnnTEyM2JmAGBIp2+qkphpqMVqSVjCJsJbmPfVbzPNUOpi5jUPYoOwfXfNPs7Xxpm3cGTkXUnAiYjHstQPK5F6JHQIGk+MY736F+77dEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n7BrJA5PavkzVyK1KGe8HWlNKAyaHV7WuMzVn0YbMoY=; b=sHfNUg6ZcHj90mfHkR0/0RWxbB+IUf6I5We/hfKFXvtfJI13BwBrVslgJrqDs2ORZpF1uxT/5Dg1Sjj9BFKQ+hIfDlYcdaV26baufMJn9smguqD4y1PmTvVvLTOtiJ22rqDcPZk/eijBSC3NYqsczdZtKVATAWDvtkMoYzPTlcoZsMwOfaojIIbI9VGdB5lO797Cla6nqPDyayaAHBOpB1puLHdX2jks72b2PABdNQVs6FcxKdXFqF/4TSbLwD4qRS2KhJz941fFU63UtjS6Q1SGDLGdjSX8AlhPKjyNa2H6ohPBkTO3OsLXfwOkaQ/8rowYMqMhHmfVLavNZF9CMA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AS8PR03MB7399.eurprd03.prod.outlook.com (2603:10a6:20b:2e2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Tue, 28 Jun 2022 22:14:50 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1%6]) with mapi id 15.20.5373.018; Tue, 28 Jun 2022 22:14:50 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Russell King , Paolo Abeni , linux-arm-kernel@lists.infradead.org, Eric Dumazet , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH net-next v2 20/35] net: fman: Pass params directly to mac init Date: Tue, 28 Jun 2022 18:13:49 -0400 Message-Id: <20220628221404.1444200-21-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220628221404.1444200-1-sean.anderson@seco.com> References: <20220628221404.1444200-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::16) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 429ece03-d872-4ad7-c143-08da59539eac X-MS-TrafficTypeDiagnostic: AS8PR03MB7399:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kgC7V+m3fz85ou+LxHagT3E5+D7pRiwhXeHhTF8dmDyGzwfygXybiapWhEVbDXtVq+BNVNxPnFxJNBd2W571etynS9NJo9WEHYz0XMxn/HHPlppe+LMVH3HUlJsrLMPdNcOPKPPBWUHZoTfHl0AGVZpxUDGZcPTGx1TDdrO5KF8s7QBK6nTvYQPXIb34XeDda5BzTLy/z4mh0++FUU77YIlwLkwTUugDeY6ka0aDG3ZVCKVavZc+wscBh9xRkqxskQyYS+gF8Uq3aJvIDpUsINgxi4NXnlZJ03JxKsmqINrfrylGtVsAuAjH2EtnzJ+LfoHSPnb9XVhG6Ou2Y5LEDQyprIxWlE6fCgJJOFYJDNdG/YyR+0keuB7Jqu4nM98a5QJGkvHjP1i5H0vCCu+QrFfR27VksXiI8QTmuK8TeNWURWJCYVlmzDLf4KX5YQ6s1E/N7OU60j3Dsd3zaj8+bN3VKhDMyp5ylAQXRNzCBbVgKaQrUZfw+Sz3growKWei3gR1G/JtGj8tZDSGSqG0X5iKsGv6FEFMqTNOqyb11nE8NVs+KKyus2CJavc/u5FEiZVG68CTBXGfwXo2BKbDRWAgyui6v4Best/zMCqL95d8m5b5r8GoQNL5KS1Hqd3i9/VROC509xwpncnS859GFJRTj953piQ9cYv9AzL/Xd22TOfEoWjbAJ8fmW1sY07FfAFUiUDl5KbsYcM482tlqApNPkmNeWkrfCISbxb0HVzTiX/8YPyHNIWcHiPg8sbKHyLFxQ3NlPmUbi1V07C6/JGZOPuSw9OEzX8vktQrqZs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(136003)(396003)(39850400004)(346002)(366004)(38100700002)(5660300002)(44832011)(6512007)(186003)(38350700002)(1076003)(83380400001)(86362001)(2906002)(66476007)(8936002)(6486002)(4326008)(41300700001)(8676002)(26005)(52116002)(36756003)(478600001)(66946007)(2616005)(6506007)(316002)(54906003)(66556008)(107886003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ijuwlZ8CGMa7HdB3WM8vaK2tSd32oOI0Caskfg4sl3kK0qJe5HNrrXhYLRl04ROSdqoW6ARreIPF/AL6900MA6PB2pef5iQmVU2weFoew46+FQxkFYClcwmij6pb7PTUlHZRE9NIkX4WlZeW6a34MICWHDYXEQdD+7dM0qbISz/bw1UcD7FW2Yj753oU9pzzWUGyRWju31D9NGRzHtH8jp1a8R0/69EceBVCFdO3DBgdYSwe6Hnd3454UIXSsspYtY0BOjZlmvGyNhnoDOy9/LXrgSCJmm0seszO4+7+BX2puz2X95MEOt2cQIFiOWmvVIHVA0osFRAwiKCL53u29r+9bYgUt83pxp3k957Zu+fyzlQ/TNekCJquN6/UAjwjCfmCCOhz7ausGZ/Ebw1jn56LDeYFIbWzjWn5/kpCZD3iZEmc0/gylpAkakUs0TH66zeaIY3jKxxHbMU30ngrH/th89sO4if+zVFSOdM+Oip8BsO+WHXvnBHkx/XwyUKODhlttg/aQem9VqWIS8/75WtiTz0m3Cz8fXdnCK5KU2D+EYz+tdrWJRbuqVXanWWV7nxS0cbIRg9txWB5VHVprOcP8hBwT5X4Un/xVWrnMbt0uIDhZXFrGy/OesH9Zkzo6wttPN78XEPE25pNvkNISPJKR3roK4dfal6uVFNWMXrotxfxz6rZ8ZNwcz1rftkB1szbzzVThY+61ZcrAHZ2v+t/ykqPGctzYrTVOgg0X4K//XTD00XTWRrmBjp6SCBx1kCYSwKhza1usVmMre2Zfr3FmyOZu1I7xJ/eltjrkEzLGBPncP9oPZXz1nHamWE8H3W7mf+PGpigQfQ0kzewY5Owg+HyEdIBtvLMjaCNLHWtTrYgayANNOvG81oGyDoOn8SLLUe9WeCnMnqq06ESQoZASqjYqoi1/MTrmGLAClraTuScoRcM2pxLuSaH91oyw8bJ5lhF2buZKCASgJxJ4SOAN3yg44Wn0CAxXJoaqMqmLKrY8pnT9Gizy6uGZC+/C8eNXY4gTHVrXVY7INyLWAA41H9Irgjq9JR3ftknE6gmw3QHqXJ/X/U00UfNK4U3ieRx/wPpxpNkE9PvoU6MTZjEj07n6x108B6j99Zf3HAxdO7r0nhQUMachHM98c9epS4QYNg4coFduwTEXuJ003/Q7pTgOyrjGOnrrgVC6f3JGefF+rndPr2+1aJHTLvyrJbfes48mjjihZN1bj1MZ2Dq93DrnrTVUHpmXmw9JMOU76tTdu/eP/d2QT+9aXQwSMmOlzXoLvFdo9ERqALkjFKmJ1nYTzpHEmC14t9iHeEHsgrjGyNjsw7YrYVVWuY4dYjMCn1sBeGlVMMGvbchF3RT9N4ZvpzhGuzcPfi23RCMe6ILeMJmt6SfktXvFLe+Z156G1mtyBjUPOz5oGmUivQWVDTau4iB4CJN0WuLbs1oJYZBfueWHAte7t1b75kA2XsTZMSopzx9MyTQra76g+E8He/VciH2g6fy8CnYA2nkYEhSg7x1+5jOY85wOjG4Fvr5qoPJIh6AprfnPXWoi91QbkarUcRfD438quiguEBKvZtJ3/z6Su2ymK5D50ANcl/V2le4igzPApWhWJIYSw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 429ece03-d872-4ad7-c143-08da59539eac X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 22:14:50.6563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: omGX3ZweyR22vWHp+uYXOiCurb8xp7vWTBq8QbmWUDaGL0SELs5vOVYyItrZjRA/CWhwFMTVwbnTQzm+rZ+PuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_151505_214152_84B8B303 X-CRM114-Status: GOOD ( 15.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of having the mac init functions call back into the fman core to get their params, just pass them directly to the init functions. Signed-off-by: Sean Anderson --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 10 ++---- .../net/ethernet/freescale/fman/fman_dtsec.h | 3 +- .../net/ethernet/freescale/fman/fman_memac.c | 14 +++----- .../net/ethernet/freescale/fman/fman_memac.h | 3 +- .../net/ethernet/freescale/fman/fman_tgec.c | 10 ++---- .../net/ethernet/freescale/fman/fman_tgec.h | 3 +- drivers/net/ethernet/freescale/fman/mac.c | 36 ++++++++----------- drivers/net/ethernet/freescale/fman/mac.h | 2 -- 8 files changed, 32 insertions(+), 49 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index c2c4677451a9..9fabb2dfc972 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1474,10 +1474,10 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) } int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; - struct fman_mac_params params; struct fman_mac *dtsec; struct device_node *phy_node; @@ -1495,11 +1495,7 @@ int dtsec_initialization(struct mac_device *mac_dev, mac_dev->enable = dtsec_enable; mac_dev->disable = dtsec_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = dtsec_config(¶ms); + mac_dev->fman_mac = dtsec_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.h b/drivers/net/ethernet/freescale/fman/fman_dtsec.h index cf3e683c089c..8c72d280c51a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.h +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.h @@ -11,6 +11,7 @@ struct mac_device; int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __DTSEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 5c0b837ebcbc..7121be0f958b 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1154,11 +1154,11 @@ static struct fman_mac *memac_config(struct fman_mac_params *params) } int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; struct device_node *phy_node; - struct fman_mac_params params; struct fixed_phy_status *fixed_link; struct fman_mac *memac; @@ -1176,14 +1176,10 @@ int memac_initialization(struct mac_device *mac_dev, mac_dev->enable = memac_enable; mac_dev->disable = memac_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; + if (params->max_speed == SPEED_10000) + params->phy_if = PHY_INTERFACE_MODE_XGMII; - if (params.max_speed == SPEED_10000) - params.phy_if = PHY_INTERFACE_MODE_XGMII; - - mac_dev->fman_mac = memac_config(¶ms); + mac_dev->fman_mac = memac_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.h b/drivers/net/ethernet/freescale/fman/fman_memac.h index a58215a3b1d9..5a3a14f9684f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.h +++ b/drivers/net/ethernet/freescale/fman/fman_memac.h @@ -14,6 +14,7 @@ struct mac_device; int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __MEMAC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 32ee1674ff2f..f34f89e46a6f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -783,10 +783,10 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) } int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; - struct fman_mac_params params; struct fman_mac *tgec; mac_dev->set_promisc = tgec_set_promiscuous; @@ -803,11 +803,7 @@ int tgec_initialization(struct mac_device *mac_dev, mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = tgec_config(¶ms); + mac_dev->fman_mac = tgec_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.h b/drivers/net/ethernet/freescale/fman/fman_tgec.h index 2e45b9fea352..768b8d165e05 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.h +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.h @@ -11,6 +11,7 @@ struct mac_device; int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __TGEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 62af81c0c942..fb04c1f9cd3e 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -57,25 +57,6 @@ static void mac_exception(void *handle, enum fman_mac_exceptions ex) __func__, ex); } -int set_fman_mac_params(struct mac_device *mac_dev, - struct fman_mac_params *params) -{ - struct mac_priv_s *priv = mac_dev->priv; - - params->base_addr = mac_dev->vaddr; - memcpy(¶ms->addr, mac_dev->addr, sizeof(mac_dev->addr)); - params->max_speed = priv->max_speed; - params->phy_if = mac_dev->phy_if; - params->basex_if = false; - params->mac_id = priv->cell_index; - params->fm = (void *)priv->fman; - params->exception_cb = mac_exception; - params->event_cb = mac_exception; - params->dev_id = mac_dev; - - return 0; -} - int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev) { struct mac_priv_s *priv; @@ -294,13 +275,15 @@ MODULE_DEVICE_TABLE(of, mac_match); static int mac_probe(struct platform_device *_of_dev) { int err, i, nph; - int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); + int (*init)(struct mac_device *mac_dev, struct device_node *mac_node, + struct fman_mac_params *params); struct device *dev; struct device_node *mac_node, *dev_node; struct mac_device *mac_dev; struct platform_device *of_dev; struct resource *res; struct mac_priv_s *priv; + struct fman_mac_params params; u32 val; u8 fman_id; phy_interface_t phy_if; @@ -474,7 +457,18 @@ static int mac_probe(struct platform_device *_of_dev) /* Get the rest of the PHY information */ mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0); - err = init(mac_dev, mac_node); + params.base_addr = mac_dev->vaddr; + memcpy(¶ms.addr, mac_dev->addr, sizeof(mac_dev->addr)); + params.max_speed = priv->max_speed; + params.phy_if = mac_dev->phy_if; + params.basex_if = false; + params.mac_id = priv->cell_index; + params.fm = (void *)priv->fman; + params.exception_cb = mac_exception; + params.event_cb = mac_exception; + params.dev_id = mac_dev; + + err = init(mac_dev, mac_node, ¶ms); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 7aa71b05bd3e..c5fb4d46210f 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -72,8 +72,6 @@ int fman_set_mac_active_pause(struct mac_device *mac_dev, bool rx, bool tx); void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, bool *tx_pause); -int set_fman_mac_params(struct mac_device *mac_dev, - struct fman_mac_params *params); int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev); #endif /* __MAC_H */