From patchwork Fri Jun 17 20:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12886025 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 CB9B3C433EF for ; Fri, 17 Jun 2022 20:50:24 +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=1EpyP4wElmLw5tkijl/Df8Pypc/0+cP+geMy2FFL+RA=; b=lhCSsmwzOWLo5e /Tcf7oyv42QmrZeGWbzwGDZg0WewqsDVRIvXQ903qU5roEjBeajKNPSa/CLnahSncV2+jR5OZ49W6 bKi1NvNVE+tYK1v9SJSgf/+rIvY68/FDvHagNmKs5U5OIAghvEuaI8obG2goGR7zAy1Qq06G+mmAK mGMh+Wh1o/bA0ZxHhwKb0hze+qR/P2eV8UdRZd9E2iO6woxdCkb5q8291mnn2q1L1/c4Xu5cUaonl qx2whQQe3eiXqIGRAPndWSAE433Ht4vDPPL8IF5y9y15FxCFegy3ZGeVgUKf8zbOEUA47t/9Pm74O lM5EQCYVYKfHpxh/YJ9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2ItX-0092vi-Ab; Fri, 17 Jun 2022 20:48:45 +0000 Received: from mail-db5eur01on060f.outbound.protection.outlook.com ([2a01:111:f400:fe02::60f] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2Ifg-008xNk-5v for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 20:34:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8LbO9XGOyTih7rpI+B01AMmTOi53r0coZhlgFoCE8FirnBngZNHlnwxe2QEnItiobM6H4FUNMsOLMzksXdAAbY76pFu7FiWT9N4IhZ4yMCPmz0aJ4Fskz7MCPXglVdcxgeOoqHg9PUG32Sn34xveRTKJrNgWxa3gWMHaXl3R5AWF9VowylgWFc/Vuf89jSoykE+yN0QCaw9mcTT2ehpx8FX/sGJbi+l6p499sb/I0oTSgQ9XmyruDTxgjxOis6pJkU8xWqjrVLlLEnsKYzant/+MUZe5rgdR98G76EPSiFW3dyI00B8mvR8Td88jpFBsRh/x7e1lGTDwVaHCUUuFw== 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=knf8F4siXxtCncC3B93OaHHxgIiSqV8hDBSDjUjkcCU=; b=PbKq6wuRInpP6UtznZtRFr2LlsuQ2GfrqsdwBwSXrlVk0TjwlgNslJogd2LJK56ZJjR4yxsDsXT6W1i6OgQ/TMONoSLnj1ceWYNxxLYyzfat7uVNsCh6oV5xSOdC88S4NxOrwi/VUxGGk9rViNQMJSGmNSy5NwmdAmF158HYnk1ojCCYLeqEOgzj0pavjoUuNeTziD7isgbF+o0b298V84+QCrVmVeF617E1KOYgXgb34X/ofENC/HyIwXZz0y3peGusBXeSxbv4inhl9CQxfNRjI74uGmzWKOEYnTnzr9OPVIipeN4U4sPzE4aNQlVexpPc55j3m+AddUCrfLqKKA== 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=knf8F4siXxtCncC3B93OaHHxgIiSqV8hDBSDjUjkcCU=; b=TrLGeKjxhjZcLJ2t6IIo+Mv/J5nG26PFwgOC7eSxS/l+CpAcPCTpIzQV5bwZi4LgAtTrc1qun+pOFz5iEvkOURK4IcR6cVW0U8S+JW+O+zEWpKGtdVnoQJ9VjTjXaTomKqawrCVnHUtBoWHITtlBGASUxaZJlo2AKyVk6lypLhcB4PYRmacRdJx2w5W9sV/ZeEZL1+n8SxGXgSUHDuValo29cxm2+JiRvX/CEDPcQPvsZxQoAdO4bNGZOvYSPCQSuMi5W54Pj7ORs8VA7JXiXoFOS2yrv84Pe5OqDH6xL5BaKGQhXdiSVr/ovNqNaa/zz2yDBadElM+ld8/rqi/brQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by AS8PR03MB6838.eurprd03.prod.outlook.com (2603:10a6:20b:29b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Fri, 17 Jun 2022 20:34:14 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d%7]) with mapi id 15.20.5353.016; Fri, 17 Jun 2022 20:34:14 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Abeni , Russell King , Eric Dumazet , Sean Anderson Subject: [PATCH net-next 20/28] net: fman: Use mac_dev for some params Date: Fri, 17 Jun 2022 16:33:04 -0400 Message-Id: <20220617203312.3799646-21-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220617203312.3799646-1-sean.anderson@seco.com> References: <20220617203312.3799646-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0384.namprd13.prod.outlook.com (2603:10b6:208:2c0::29) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f3b51a3-181d-4441-90b3-08da50a0be00 X-MS-TrafficTypeDiagnostic: AS8PR03MB6838:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r8lqS4Z5VuvipCt+OQxGqSDdjka6BFGUgheUVlHK2/9t0ugh+rso1A77Z4Rg1NASteSFcpo8dXO3OwX9ap83IZQjaOyPApxQhhO2VIArO+S+SaQmeiOeZZpUrWSffR38fKiQaOMncGNTzSG/VNYhHmSMfJGn38AOz4udhHrIKT1Nlx/nERQhsVkJ5uWfYMppeGgM/JIw0t70peIu//VvfSblsbaA69pHm64Golc+uAHIjxpZQHU86/T4gsTFiso67EXNUutXrKZZpl2eUv7yXxlmORVTkRom1CBKBPOTkyjco4TUnri6UEhTyFU5FhYvj945g2yVZME8CNZFp05tKAIWxZYMSqrb/sChKfMJta/uh7MBwkxm3EYFPn2wr+LU6vPpIFL8K2wLO7na0/6HpvhYGxDUa14qQJ3qSSOdycImh+3kH2me0IMbVJDkDTVRCKaUW9x1IKu6P49sFH+1Z4LevaeNQvZKGHr2NHxdlbdFsAmQGnI4nmE8NoIxDOar8xWnmTEMen7hziuzE6TrCJoGJg0F1/JRUfK5e5R1wlHbcSs5YcEnpdda81rlzL1/JX+tj7Sjx6iUm+RObwvFVtMBTChHkMWpiWNJlASeITI63O/axoc7Xa4TKLpj7C4nkXv5LSKoPghQs7i1mOZ0HPI2+QdgNIZ4otBpdLxy6kN/vwJWv5fyMyFFFK+AphU6FzouRnD1wb/Soi/+/78NUQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(44832011)(2616005)(38100700002)(38350700002)(8936002)(52116002)(26005)(316002)(36756003)(6512007)(2906002)(4326008)(66476007)(6486002)(66556008)(6506007)(5660300002)(107886003)(83380400001)(8676002)(86362001)(186003)(66946007)(6666004)(1076003)(54906003)(110136005)(498600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0S0gYxQfHBIcE9AFk9X9iAHJfk91aG5DC3QLpsYuIq1VZjLEjfoNB3BJ13o/Q+3QiqKIwEr+YhMuhtoWnkdu1uCMraOxNpP/3tS4i905xrpAPq4er0iYuhhi8zR/ydqKl+dhmOjYIt6rdkEjnc5QA7f9tRKQ2rYJmeYZ2+YTMCvDYrrYKEDHRADXRQVJoMEiRw+FuswqGogCaa/rcioJSKTGjx1niQMnl2EtkL/ENhLjFqC1+bLOslEET2DFZZZDIKOPnJ8eTkLQOnY4dr3FFYsObEiA9GqomqzKyfkck31TyilRA0K4N6bdIq0xuzYbKCU4eaL1/vVd/BTofoSRX33rZoWPTBQM4I7HxqMP15qOxVegs8Kqrlh5sAmt/CkrmDoM7CLsMqUnFrg4DOy9yTKymaixMlf9X50W3SOO4Y24PkfA1TAnsz4+fScVdmMZYBagN/irAPwL2tqt4s2Wtg8Kp541umJHwxfun+TfsLKkIupaYOo4CtF8AzhXqxaagHWAs7DB24Ub5rNLV3qQvTSy+z63JrmQzNbSpn5Gn2TNKAT88BwNXrnTIPfxY9771k+rSQQAh83AKESyBYgSXQ1lS6nWMIwL9LpqN1/gGzoDjXDhag/kdifTeOa5OviwFB88y7ra8vGOO9yAiBLDcIVyc/kqi3gNDpIlf9QVTEFHJrrYU1FXxYYZYTHD4Og8Obpf+oMvuDR+919xWyXkVsj6h+RGvAI+89J4daT84H1SFb/nFbdhT2xiNek60eurXS+yWsCMzUR1z0YkDA9NLu5UReZa6PL/ZC2us4O9XAl8yu2wekBYtvsih1iptBUynMKCKlbfrbyF7/YJjmYJHekl/yB9XQZk/CXZirfaTs8d23lQmynBW84IJDmq/wZvILreYnnHJFsFOLyGg9x6zJ0hHFZWDoz68j1pnabP33uP6v/9rfXJWnYYlOib/PBqkP2ueYx8x2pWUM/FaT3Hzv0WjqzRs73kDdoU4zX7OZdiUlSDqK4Fb4sbFhQzt2t2c5v6YJs5TWm77Mws6ig4JS5YOD7euABV2NTU/qtYvQdRTnI42kcH6mBaE5XWJNqt+g5yldpSYwt9IdrW6bskB4+8cafvVv6roiKxhmvy/I1YuHh6AR3l1Qo8sNkzaNsgEg8gXrK6s4aMlaValf20bH/PaK22Nq852Gjwrk+VWbMRTWShNiUv41wojpFB+hdjZYCPRo3Ud7hwZm1nu9SN7dPLcBd2hpzFseAvo+zAbupVvS7eCDIUB1jhnhNifvcin6bTOtjReo9ha2P/NTg7p++SWdogQ7HIY8YN/sxiiusrg3fktWjd9QvwzjBCIGrpYpXM/odyRcKquVO7Gsg6XVxo4hvW2X8LbW2Zr2L9FK1l6jwYN82DbSBbYU2S6HI+rrQVNGPtYjJZtNfH7wVi5h7qkzrbF+pm5E/LCrg0exOZhilPLjbHVSO54tVyKxrXFgJCZiyrOJV0D261Q9YH3AMMHpAkFBo34CkvtybokUR9I66U+miMBBL94vaPUSSu1Q3KJ7b7CNTeNOTUEzwdNDP7T67WUJN3SnXXU17xmHubdknAZU4UUCZPnHWJMIU/5ZzGjMhE7zV3rl4OosD+kVCphjN04eFGpjKEifFRhpmLYRUBzYAtSyLnC+ls70KYP+nJ0mXMDLanjNH0jtXzgfB4VZT5oqlVuHHgThdSK4+8wb0cdi1R5PBwlEsdq0JSn1xKOJtShHVaoRMck7ymHZqq+I3VIbLlJGSH5XfUZ/Q= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f3b51a3-181d-4441-90b3-08da50a0be00 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 20:34:14.1543 (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: RInXRH7apvkIVlFoGFHVJqlQAz3O0/b5VFbvYRvGOR0j/n8ocr/sH5RsfSy/9cTUnbFbC5Wwhu2jkZ3dTAaRCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB6838 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_133424_405786_12791707 X-CRM114-Status: GOOD ( 14.14 ) 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 Some params are already present in mac_dev. Use them directly instead of passing them through params. Signed-off-by: Sean Anderson --- .../net/ethernet/freescale/fman/fman_dtsec.c | 16 +++++++--------- drivers/net/ethernet/freescale/fman/fman_mac.h | 7 ------- .../net/ethernet/freescale/fman/fman_memac.c | 17 ++++++++--------- drivers/net/ethernet/freescale/fman/fman_tgec.c | 12 +++++------- drivers/net/ethernet/freescale/fman/mac.c | 10 ++-------- 5 files changed, 22 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 7acdaed67d9d..c5cc20b9ebed 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1413,13 +1413,11 @@ static int dtsec_free(struct fman_mac *dtsec) return 0; } -static struct fman_mac *dtsec_config(struct fman_mac_params *params) +static struct fman_mac *dtsec_config(struct mac_device *mac_dev, + struct fman_mac_params *params) { struct fman_mac *dtsec; struct dtsec_cfg *dtsec_drv_param; - void __iomem *base_addr; - - base_addr = params->base_addr; /* allocate memory for the UCC GETH data structure. */ dtsec = kzalloc(sizeof(*dtsec), GFP_KERNEL); @@ -1436,10 +1434,10 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) set_dflts(dtsec_drv_param); - dtsec->regs = base_addr; - dtsec->addr = ENET_ADDR_TO_UINT64(params->addr); + dtsec->regs = mac_dev->vaddr; + dtsec->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); dtsec->max_speed = params->max_speed; - dtsec->phy_if = params->phy_if; + dtsec->phy_if = mac_dev->phy_if; dtsec->mac_id = params->mac_id; dtsec->exceptions = (DTSEC_IMASK_BREN | DTSEC_IMASK_RXCEN | @@ -1456,7 +1454,7 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) DTSEC_IMASK_RDPEEN); dtsec->exception_cb = params->exception_cb; dtsec->event_cb = params->event_cb; - dtsec->dev_id = params->dev_id; + dtsec->dev_id = mac_dev; dtsec->ptp_tsu_enabled = dtsec->dtsec_drv_param->ptp_tsu_en; dtsec->en_tsu_err_exception = dtsec->dtsec_drv_param->ptp_exception_en; @@ -1497,7 +1495,7 @@ int dtsec_initialization(struct mac_device *mac_dev, mac_dev->enable = dtsec_enable; mac_dev->disable = dtsec_disable; - mac_dev->fman_mac = dtsec_config(params); + mac_dev->fman_mac = dtsec_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 7774af6463e5..730aae7fed13 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -163,25 +163,18 @@ typedef void (fman_mac_exception_cb)(void *dev_id, /* FMan MAC config input */ struct fman_mac_params { - /* Base of memory mapped FM MAC registers */ - void __iomem *base_addr; - /* MAC address of device; First octet is sent first */ - enet_addr_t addr; /* MAC ID; numbering of dTSEC and 1G-mEMAC: * 0 - FM_MAX_NUM_OF_1G_MACS; * numbering of 10G-MAC (TGEC) and 10G-mEMAC: * 0 - FM_MAX_NUM_OF_10G_MACS */ u8 mac_id; - /* PHY interface */ - phy_interface_t phy_if; /* Note that the speed should indicate the maximum rate that * this MAC should support rather than the actual speed; */ u16 max_speed; /* A handle to the FM object this port related to */ void *fm; - void *dev_id; /* device cookie used by the exception cbs */ fman_mac_exception_cb *event_cb; /* MDIO Events Callback Routine */ fman_mac_exception_cb *exception_cb;/* Exception Callback Routine */ /* SGMII/QSGII interface with 1000BaseX auto-negotiation between MAC diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index fa84467e10da..4d4c235d5dbc 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1109,13 +1109,12 @@ static int memac_free(struct fman_mac *memac) return 0; } -static struct fman_mac *memac_config(struct fman_mac_params *params) +static struct fman_mac *memac_config(struct mac_device *mac_dev, + struct fman_mac_params *params) { struct fman_mac *memac; struct memac_cfg *memac_drv_param; - void __iomem *base_addr; - base_addr = params->base_addr; /* allocate memory for the m_emac data structure */ memac = kzalloc(sizeof(*memac), GFP_KERNEL); if (!memac) @@ -1133,17 +1132,17 @@ static struct fman_mac *memac_config(struct fman_mac_params *params) set_dflts(memac_drv_param); - memac->addr = ENET_ADDR_TO_UINT64(params->addr); + memac->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); - memac->regs = base_addr; + memac->regs = mac_dev->vaddr; memac->max_speed = params->max_speed; - memac->phy_if = params->phy_if; + memac->phy_if = mac_dev->phy_if; memac->mac_id = params->mac_id; memac->exceptions = (MEMAC_IMASK_TSECC_ER | MEMAC_IMASK_TECC_ER | MEMAC_IMASK_RECC_ER | MEMAC_IMASK_MGI); memac->exception_cb = params->exception_cb; memac->event_cb = params->event_cb; - memac->dev_id = params->dev_id; + memac->dev_id = mac_dev; memac->fm = params->fm; memac->basex_if = params->basex_if; @@ -1179,9 +1178,9 @@ int memac_initialization(struct mac_device *mac_dev, mac_dev->disable = memac_disable; if (params->max_speed == SPEED_10000) - params->phy_if = PHY_INTERFACE_MODE_XGMII; + mac_dev->phy_if = PHY_INTERFACE_MODE_XGMII; - mac_dev->fman_mac = memac_config(params); + mac_dev->fman_mac = memac_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index f34f89e46a6f..2642a4c27292 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -728,13 +728,11 @@ static int tgec_free(struct fman_mac *tgec) return 0; } -static struct fman_mac *tgec_config(struct fman_mac_params *params) +static struct fman_mac *tgec_config(struct mac_device *mac_dev, struct fman_mac_params *params) { struct fman_mac *tgec; struct tgec_cfg *cfg; - void __iomem *base_addr; - base_addr = params->base_addr; /* allocate memory for the UCC GETH data structure. */ tgec = kzalloc(sizeof(*tgec), GFP_KERNEL); if (!tgec) @@ -752,8 +750,8 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) set_dflts(cfg); - tgec->regs = base_addr; - tgec->addr = ENET_ADDR_TO_UINT64(params->addr); + tgec->regs = mac_dev->vaddr; + tgec->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); tgec->max_speed = params->max_speed; tgec->mac_id = params->mac_id; tgec->exceptions = (TGEC_IMASK_MDIO_SCAN_EVENT | @@ -773,7 +771,7 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) TGEC_IMASK_RX_ALIGN_ER); tgec->exception_cb = params->exception_cb; tgec->event_cb = params->event_cb; - tgec->dev_id = params->dev_id; + tgec->dev_id = mac_dev; tgec->fm = params->fm; /* Save FMan revision */ @@ -803,7 +801,7 @@ int tgec_initialization(struct mac_device *mac_dev, mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; - mac_dev->fman_mac = tgec_config(params); + mac_dev->fman_mac = tgec_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 5d08c4696c21..88b9174531a6 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -34,7 +34,6 @@ struct mac_priv_s { struct list_head mc_addr_list; struct platform_device *eth_dev; u16 speed; - u16 max_speed; }; struct mac_address { @@ -443,7 +442,7 @@ static int mac_probe(struct platform_device *_of_dev) mac_dev->phy_if = phy_if; priv->speed = phy2speed[mac_dev->phy_if]; - priv->max_speed = priv->speed; + params.max_speed = priv->speed; mac_dev->if_support = DTSEC_SUPPORTED; /* We don't support half-duplex in SGMII mode */ if (mac_dev->phy_if == PHY_INTERFACE_MODE_SGMII) @@ -451,7 +450,7 @@ static int mac_probe(struct platform_device *_of_dev) SUPPORTED_100baseT_Half); /* Gigabit support (no half-duplex) */ - if (priv->max_speed == 1000) + if (params.max_speed == 1000) mac_dev->if_support |= SUPPORTED_1000baseT_Full; /* The 10G interface only supports one mode */ @@ -461,16 +460,11 @@ 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); - 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) {