xgbe.h revision 23e4eef7cf56b5e36e76af9078f0012826c86b2f
1c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* 2c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * AMD 10Gb Ethernet driver 3c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 4c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * This file is available to you under your choice of the following two 5c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * licenses: 6c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 7c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * License 1: GPLv2 8c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 9c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Copyright (c) 2014 Advanced Micro Devices, Inc. 10c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 11c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * This file is free software; you may copy, redistribute and/or modify 12c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * it under the terms of the GNU General Public License as published by 13c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * the Free Software Foundation, either version 2 of the License, or (at 14c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * your option) any later version. 15c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 16c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * This file is distributed in the hope that it will be useful, but 17c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * WITHOUT ANY WARRANTY; without even the implied warranty of 18c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * General Public License for more details. 20c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 21c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * You should have received a copy of the GNU General Public License 22c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * along with this program. If not, see <http://www.gnu.org/licenses/>. 23c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 24c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * This file incorporates work covered by the following copyright and 25c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * permission notice: 26c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The Synopsys DWC ETHER XGMAC Software Driver and documentation 27c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * (hereinafter "Software") is an unsupported proprietary work of Synopsys, 28c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Inc. unless otherwise expressly agreed to in writing between Synopsys 29c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * and you. 30c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 31c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The Software IS NOT an item of Licensed Software or Licensed Product 32c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * under any End User Software License Agreement or Agreement for Licensed 33c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Product with Synopsys or any supplement thereto. Permission is hereby 34c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * granted, free of charge, to any person obtaining a copy of this software 35c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * annotated with this license and the Software, to deal in the Software 36c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * without restriction, including without limitation the rights to use, 37c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 38c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * of the Software, and to permit persons to whom the Software is furnished 39c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * to do so, subject to the following conditions: 40c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 41c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The above copyright notice and this permission notice shall be included 42c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * in all copies or substantial portions of the Software. 43c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 44c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" 45c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 46c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 47c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS 48c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 49c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 50c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 51c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 52c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 53c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 54c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THE POSSIBILITY OF SUCH DAMAGE. 55c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 56c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 57c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * License 2: Modified BSD 58c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 59c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Copyright (c) 2014 Advanced Micro Devices, Inc. 60c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * All rights reserved. 61c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 62c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Redistribution and use in source and binary forms, with or without 63c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * modification, are permitted provided that the following conditions are met: 64c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * * Redistributions of source code must retain the above copyright 65c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * notice, this list of conditions and the following disclaimer. 66c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * * Redistributions in binary form must reproduce the above copyright 67c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * notice, this list of conditions and the following disclaimer in the 68c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * documentation and/or other materials provided with the distribution. 69c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * * Neither the name of Advanced Micro Devices, Inc. nor the 70c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * names of its contributors may be used to endorse or promote products 71c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * derived from this software without specific prior written permission. 72c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 73c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 74c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 75c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 76c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 77c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 78c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 79c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 80c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 81c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 82c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 83c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 84c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * This file incorporates work covered by the following copyright and 85c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * permission notice: 86c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The Synopsys DWC ETHER XGMAC Software Driver and documentation 87c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * (hereinafter "Software") is an unsupported proprietary work of Synopsys, 88c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Inc. unless otherwise expressly agreed to in writing between Synopsys 89c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * and you. 90c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 91c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The Software IS NOT an item of Licensed Software or Licensed Product 92c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * under any End User Software License Agreement or Agreement for Licensed 93c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Product with Synopsys or any supplement thereto. Permission is hereby 94c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * granted, free of charge, to any person obtaining a copy of this software 95c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * annotated with this license and the Software, to deal in the Software 96c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * without restriction, including without limitation the rights to use, 97c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 98c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * of the Software, and to permit persons to whom the Software is furnished 99c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * to do so, subject to the following conditions: 100c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 101c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * The above copyright notice and this permission notice shall be included 102c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * in all copies or substantial portions of the Software. 103c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * 104c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" 105c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 106c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 107c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS 108c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 109c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 110c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 111c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 112c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 113c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 114c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * THE POSSIBILITY OF SUCH DAMAGE. 115c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 116c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 117c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#ifndef __XGBE_H__ 118c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define __XGBE_H__ 119c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 120c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#include <linux/dma-mapping.h> 121c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#include <linux/netdevice.h> 122c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#include <linux/workqueue.h> 123c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#include <linux/phy.h> 124801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas#include <linux/if_vlan.h> 125801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas#include <linux/bitops.h> 12623e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#include <linux/ptp_clock_kernel.h> 12723e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#include <linux/clocksource.h> 12823e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#include <linux/net_tstamp.h> 129c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 130c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 131c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_DRV_NAME "amd-xgbe" 132c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_DRV_VERSION "1.0.0-a" 133c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_DRV_DESC "AMD 10 Gigabit Ethernet Driver" 134c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 135c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Descriptor related defines */ 136d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_TX_DESC_CNT 512 137d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_TX_DESC_MIN_FREE (XGBE_TX_DESC_CNT >> 3) 138d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_TX_DESC_MAX_PROC (XGBE_TX_DESC_CNT >> 1) 139d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_RX_DESC_CNT 512 140c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 141d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_TX_MAX_BUF_SIZE (0x3fff & ~(64 - 1)) 142c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 143d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_RX_MIN_BUF_SIZE (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN) 144d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_RX_BUF_ALIGN 64 145c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 146d5c4858237fe43c30714f4447ccec87d5fb3fcdeLendacky, Thomas#define XGBE_MAX_DMA_CHANNELS 16 147d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas 148d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas/* DMA cache settings - Outer sharable, write-back, write-allocate */ 149cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_OS_AXDOMAIN 0x2 150cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_OS_ARCACHE 0xb 151cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_OS_AWCACHE 0xf 152cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas 153cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas/* DMA cache settings - System, no caches used */ 154cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_SYS_AXDOMAIN 0x3 155cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_SYS_ARCACHE 0x0 156cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas#define XGBE_DMA_SYS_AWCACHE 0x0 157d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas 158d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_DMA_INTERRUPT_MASK 0x31c7 159c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 160c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_MIN_PACKET 60 161c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_STD_PACKET_MTU 1500 162c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_MAX_STD_PACKET 1518 163c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_JUMBO_PACKET_MTU 9000 164c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_MAX_JUMBO_PACKET 9018 165c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 166c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* MDIO bus phy name */ 167c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_PHY_NAME "amd_xgbe_phy" 168c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_PRTAD 0 169c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 17023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas/* Device-tree clock names */ 17123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#define XGBE_DMA_CLOCK "dma_clk" 17223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#define XGBE_PTP_CLOCK "ptp_clk" 17323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 17423e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas/* Timestamp support - values based on 50MHz PTP clock 17523e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas * 50MHz => 20 nsec 17623e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas */ 17723e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#define XGBE_TSTAMP_SSINC 20 17823e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas#define XGBE_TSTAMP_SNSINC 0 17923e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 180c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Driver PMT macros */ 181c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_DRIVER_CONTEXT 1 182c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_IOCTL_CONTEXT 2 183c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 184d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_FIFO_SIZE_B(x) (x) 185d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_FIFO_SIZE_KB(x) (x * 1024) 186c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 187c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGBE_TC_CNT 2 188c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 189c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Helper macro for descriptor handling 190d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas * Always use XGBE_GET_DESC_DATA to access the descriptor data 191c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * since the index is free-running and needs to be and-ed 192c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * with the descriptor count value of the ring to index to 193c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * the proper descriptor data. 194c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 195d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas#define XGBE_GET_DESC_DATA(_ring, _idx) \ 196c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas ((_ring)->rdata + \ 197c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas ((_idx) & ((_ring)->rdesc_count - 1))) 198c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 199c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 200c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Default coalescing parameters */ 2019867e8fb2c45888cc594457914dcbba599f086c8Lendacky, Thomas#define XGMAC_INIT_DMA_TX_USECS 50 2029867e8fb2c45888cc594457914dcbba599f086c8Lendacky, Thomas#define XGMAC_INIT_DMA_TX_FRAMES 25 203c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 204c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_MAX_DMA_RIWT 0xff 2059867e8fb2c45888cc594457914dcbba599f086c8Lendacky, Thomas#define XGMAC_INIT_DMA_RX_USECS 30 2069867e8fb2c45888cc594457914dcbba599f086c8Lendacky, Thomas#define XGMAC_INIT_DMA_RX_FRAMES 25 207c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 208c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Flow control queue count */ 209c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_MAX_FLOW_CONTROL_QUEUES 8 210c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 211b85e4d8960f10e4b28613a3e7b76f8889a2089e3Lendacky, Thomas/* Maximum MAC address hash table size (256 bits = 8 bytes) */ 212b85e4d8960f10e4b28613a3e7b76f8889a2089e3Lendacky, Thomas#define XGBE_MAC_HASH_TABLE_SIZE 8 213c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 214c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_prv_data; 215c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 216c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_packet_data { 217c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int attributes; 218c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 219c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int errors; 220c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 221c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rdesc_count; 222c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int length; 223c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 224c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int header_len; 225c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tcp_header_len; 226c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tcp_payload_len; 227c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned short mss; 228c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 229c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned short vlan_ctag; 23023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 23123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas u64 rx_tstamp; 232c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 233c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 234c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Common Rx and Tx descriptor mapping */ 235c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_ring_desc { 236c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int desc0; 237c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int desc1; 238c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int desc2; 239c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int desc3; 240c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 241c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 242c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Structure used to hold information related to the descriptor 243c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * and the packet associated with the descriptor (always use 244d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas * use the XGBE_GET_DESC_DATA macro to access this data from the ring) 245c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 246c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_ring_data { 247c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_ring_desc *rdesc; /* Virtual address of descriptor */ 248c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas dma_addr_t rdesc_dma; /* DMA address of descriptor */ 249c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 250c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct sk_buff *skb; /* Virtual address of SKB */ 251c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas dma_addr_t skb_dma; /* DMA address of SKB data */ 252c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int skb_dma_len; /* Length of SKB DMA area */ 253c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tso_header; /* TSO header indicator */ 254c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 255c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned short len; /* Length of received Rx packet */ 256c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 257c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int interrupt; /* Interrupt indicator */ 258c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 259c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int mapped_as_page; 26023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 26123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas /* Incomplete receive save location. If the budget is exhausted 26223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas * or the last descriptor (last normal descriptor or a following 26323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas * context descriptor) has not been DMA'd yet the current state 26423e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas * of the receive processing needs to be saved. 26523e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas */ 26623e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int state_saved; 26723e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct { 26823e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int incomplete; 26923e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int context_next; 27023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct sk_buff *skb; 27123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int len; 27223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int error; 27323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas } state; 274c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 275c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 276c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_ring { 277c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Ring lock - used just for TX rings at the moment */ 278c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas spinlock_t lock; 279c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 280c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Per packet related information */ 281c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_packet_data packet_data; 282c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 283c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Virtual/DMA addresses and count of allocated descriptor memory */ 284c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_ring_desc *rdesc; 285c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas dma_addr_t rdesc_dma; 286c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rdesc_count; 287c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 288c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Array of descriptor data corresponding the descriptor memory 289d0a8ba6cba0a05ce79df100a3d99502b94117d88Lendacky, Thomas * (always use the XGBE_GET_DESC_DATA macro to access this data) 290c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 291c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_ring_data *rdata; 292c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 293c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Ring index values 294c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * cur - Tx: index of descriptor to be used for current transfer 295c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Rx: index of descriptor to check for packet availability 296c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * dirty - Tx: index of descriptor to check for transfer complete 297c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * Rx: count of descriptors in which a packet has been received 298c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * (used with skb_realloc_index to refresh the ring) 299c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 300c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int cur; 301c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int dirty; 302c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 303c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Coalesce frame count used for interrupt bit setting */ 304c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int coalesce_count; 305c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 306c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas union { 307c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct { 308c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int queue_stopped; 309c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned short cur_mss; 310c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned short cur_vlan_ctag; 311c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas } tx; 312c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 313c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct { 314c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int realloc_index; 315c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int realloc_threshold; 316c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas } rx; 317c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas }; 318c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas} ____cacheline_aligned; 319c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 320c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Structure used to describe the descriptor rings associated with 321c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * a DMA channel. 322c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 323c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_channel { 324c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas char name[16]; 325c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 326c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Address of private data area for device */ 327c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_prv_data *pdata; 328c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 329c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Queue index and base address of queue's DMA registers */ 330c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int queue_index; 331c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void __iomem *dma_regs; 332c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 333c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int saved_ier; 334c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 335c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_timer_active; 336c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct hrtimer tx_timer; 337c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 338c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_ring *tx_ring; 339c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_ring *rx_ring; 340c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas} ____cacheline_aligned; 341c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 342c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasenum xgbe_int { 343c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_TI, 344c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_TPS, 345c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_TBU, 346c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_RI, 347c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_RBU, 348c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_RPS, 3499867e8fb2c45888cc594457914dcbba599f086c8Lendacky, Thomas XGMAC_INT_DMA_CH_SR_TI_RI, 350c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_CH_SR_FBE, 351c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_DMA_ALL, 352c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 353c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 354c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasenum xgbe_int_state { 355c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_STATE_SAVE, 356c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_INT_STATE_RESTORE, 357c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 358c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 359c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasenum xgbe_mtl_fifo_size { 360c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_256 = 0x00, 361c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_512 = 0x01, 362c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_1K = 0x03, 363c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_2K = 0x07, 364c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_4K = 0x0f, 365c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_8K = 0x1f, 366c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_16K = 0x3f, 367c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_32K = 0x7f, 368c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_64K = 0xff, 369c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_128K = 0x1ff, 370c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas XGMAC_MTL_FIFO_SIZE_256K = 0x3ff, 371c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 372c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 373c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_mmc_stats { 374c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Tx Stats */ 375c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txoctetcount_gb; 376c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txframecount_gb; 377c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txbroadcastframes_g; 378c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txmulticastframes_g; 379c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx64octets_gb; 380c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx65to127octets_gb; 381c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx128to255octets_gb; 382c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx256to511octets_gb; 383c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx512to1023octets_gb; 384c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 tx1024tomaxoctets_gb; 385c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txunicastframes_gb; 386c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txmulticastframes_gb; 387c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txbroadcastframes_gb; 388c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txunderflowerror; 389c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txoctetcount_g; 390c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txframecount_g; 391c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txpauseframes; 392c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 txvlanframes_g; 393c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 394c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Rx Stats */ 395c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxframecount_gb; 396c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxoctetcount_gb; 397c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxoctetcount_g; 398c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxbroadcastframes_g; 399c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxmulticastframes_g; 400c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxcrcerror; 401c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxrunterror; 402c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxjabbererror; 403c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxundersize_g; 404c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxoversize_g; 405c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx64octets_gb; 406c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx65to127octets_gb; 407c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx128to255octets_gb; 408c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx256to511octets_gb; 409c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx512to1023octets_gb; 410c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rx1024tomaxoctets_gb; 411c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxunicastframes_g; 412c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxlengtherror; 413c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxoutofrangetype; 414c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxpauseframes; 415c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxfifooverflow; 416c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxvlanframes_gb; 417c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas u64 rxwatchdogerror; 418c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 419c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 420c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_hw_if { 421c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*tx_complete)(struct xgbe_ring_desc *); 422c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 423c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_promiscuous_mode)(struct xgbe_prv_data *, unsigned int); 424c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_all_multicast_mode)(struct xgbe_prv_data *, unsigned int); 425b85e4d8960f10e4b28613a3e7b76f8889a2089e3Lendacky, Thomas int (*add_mac_addresses)(struct xgbe_prv_data *); 426c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_mac_address)(struct xgbe_prv_data *, u8 *addr); 427c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 428c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*enable_rx_csum)(struct xgbe_prv_data *); 429c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*disable_rx_csum)(struct xgbe_prv_data *); 430c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 431c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*enable_rx_vlan_stripping)(struct xgbe_prv_data *); 432c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*disable_rx_vlan_stripping)(struct xgbe_prv_data *); 433801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas int (*enable_rx_vlan_filtering)(struct xgbe_prv_data *); 434801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas int (*disable_rx_vlan_filtering)(struct xgbe_prv_data *); 435801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas int (*update_vlan_hash_table)(struct xgbe_prv_data *); 436c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 437c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*read_mmd_regs)(struct xgbe_prv_data *, int, int); 438c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*write_mmd_regs)(struct xgbe_prv_data *, int, int, int); 439c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_gmii_speed)(struct xgbe_prv_data *); 440c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_gmii_2500_speed)(struct xgbe_prv_data *); 441c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*set_xgmii_speed)(struct xgbe_prv_data *); 442c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 443c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*enable_tx)(struct xgbe_prv_data *); 444c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*disable_tx)(struct xgbe_prv_data *); 445c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*enable_rx)(struct xgbe_prv_data *); 446c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*disable_rx)(struct xgbe_prv_data *); 447c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 448c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*powerup_tx)(struct xgbe_prv_data *); 449c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*powerdown_tx)(struct xgbe_prv_data *); 450c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*powerup_rx)(struct xgbe_prv_data *); 451c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*powerdown_rx)(struct xgbe_prv_data *); 452c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 453c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*init)(struct xgbe_prv_data *); 454c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*exit)(struct xgbe_prv_data *); 455c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 456c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*enable_int)(struct xgbe_channel *, enum xgbe_int); 457c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*disable_int)(struct xgbe_channel *, enum xgbe_int); 458c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*pre_xmit)(struct xgbe_channel *); 459c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*dev_read)(struct xgbe_channel *); 460c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*tx_desc_init)(struct xgbe_channel *); 461c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*rx_desc_init)(struct xgbe_channel *); 462c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*rx_desc_reset)(struct xgbe_ring_data *); 463c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*tx_desc_reset)(struct xgbe_ring_data *); 464c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*is_last_desc)(struct xgbe_ring_desc *); 465c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*is_context_desc)(struct xgbe_ring_desc *); 466c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 467c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For FLOW ctrl */ 468c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_tx_flow_control)(struct xgbe_prv_data *); 469c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_rx_flow_control)(struct xgbe_prv_data *); 470c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 471c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For RX coalescing */ 472c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_rx_coalesce)(struct xgbe_prv_data *); 473c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_tx_coalesce)(struct xgbe_prv_data *); 474c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int (*usec_to_riwt)(struct xgbe_prv_data *, unsigned int); 475c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int (*riwt_to_usec)(struct xgbe_prv_data *, unsigned int); 476c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 477c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For RX and TX threshold config */ 478c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_rx_threshold)(struct xgbe_prv_data *, unsigned int); 479c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_tx_threshold)(struct xgbe_prv_data *, unsigned int); 480c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 481c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For RX and TX Store and Forward Mode config */ 482c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_rsf_mode)(struct xgbe_prv_data *, unsigned int); 483c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_tsf_mode)(struct xgbe_prv_data *, unsigned int); 484c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 485c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For TX DMA Operate on Second Frame config */ 486c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_osp_mode)(struct xgbe_prv_data *); 487c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 488c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For RX and TX PBL config */ 489c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_rx_pbl_val)(struct xgbe_prv_data *); 490c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*get_rx_pbl_val)(struct xgbe_prv_data *); 491c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_tx_pbl_val)(struct xgbe_prv_data *); 492c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*get_tx_pbl_val)(struct xgbe_prv_data *); 493c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*config_pblx8)(struct xgbe_prv_data *); 494c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 495c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* For MMC statistics */ 496c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*rx_mmc_int)(struct xgbe_prv_data *); 497c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*tx_mmc_int)(struct xgbe_prv_data *); 498c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*read_mmc_stats)(struct xgbe_prv_data *); 49923e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 50023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas /* For Timestamp config */ 50123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas int (*config_tstamp)(struct xgbe_prv_data *, unsigned int); 50223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas void (*update_tstamp_addend)(struct xgbe_prv_data *, unsigned int); 50323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas void (*set_tstamp_time)(struct xgbe_prv_data *, unsigned int sec, 50423e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int nsec); 50523e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas u64 (*get_tstamp_time)(struct xgbe_prv_data *); 50623e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas u64 (*get_tx_tstamp)(struct xgbe_prv_data *); 507c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 508c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 509c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_desc_if { 510c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*alloc_ring_resources)(struct xgbe_prv_data *); 511c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*free_ring_resources)(struct xgbe_prv_data *); 512c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int (*map_tx_skb)(struct xgbe_channel *, struct sk_buff *); 513c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*realloc_skb)(struct xgbe_channel *); 514c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*unmap_skb)(struct xgbe_prv_data *, struct xgbe_ring_data *); 515c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*wrapper_tx_desc_init)(struct xgbe_prv_data *); 516c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void (*wrapper_rx_desc_init)(struct xgbe_prv_data *); 517c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 518c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 519c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* This structure contains flags that indicate what hardware features 520c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas * or configurations are present in the device. 521c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas */ 522c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_hw_features { 523c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* HW Feature Register0 */ 524c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int gmii; /* 1000 Mbps support */ 525c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int vlhash; /* VLAN Hash Filter */ 526c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int sma; /* SMA(MDIO) Interface */ 527c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rwk; /* PMT remote wake-up packet */ 528c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int mgk; /* PMT magic packet */ 529c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int mmc; /* RMON module */ 530c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int aoe; /* ARP Offload */ 531c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int ts; /* IEEE 1588-2008 Adavanced Timestamp */ 532c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int eee; /* Energy Efficient Ethernet */ 533c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_coe; /* Tx Checksum Offload */ 534c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_coe; /* Rx Checksum Offload */ 535c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int addn_mac; /* Additional MAC Addresses */ 536c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int ts_src; /* Timestamp Source */ 537c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int sa_vlan_ins; /* Source Address or VLAN Insertion */ 538c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 539c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* HW Feature Register1 */ 540c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_fifo_size; /* MTL Receive FIFO Size */ 541c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_fifo_size; /* MTL Transmit FIFO Size */ 542c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int adv_ts_hi; /* Advance Timestamping High Word */ 543c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int dcb; /* DCB Feature */ 544c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int sph; /* Split Header Feature */ 545c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tso; /* TCP Segmentation Offload */ 546c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int dma_debug; /* DMA Debug Registers */ 547c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rss; /* Receive Side Scaling */ 548c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int hash_table_size; /* Hash Table Size */ 549c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int l3l4_filter_num; /* Number of L3-L4 Filters */ 550c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 551c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* HW Feature Register2 */ 552c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_q_cnt; /* Number of MTL Receive Queues */ 553c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_q_cnt; /* Number of MTL Transmit Queues */ 554c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_ch_cnt; /* Number of DMA Receive Channels */ 555c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_ch_cnt; /* Number of DMA Transmit Channels */ 556c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int pps_out_num; /* Number of PPS outputs */ 557c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int aux_snap_num; /* Number of Aux snapshot inputs */ 558c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 559c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 560c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct xgbe_prv_data { 561c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct net_device *netdev; 562c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct platform_device *pdev; 563c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct device *dev; 564c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 565c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* XGMAC/XPCS related mmio registers */ 566c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void __iomem *xgmac_regs; /* XGMAC CSRs */ 567c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas void __iomem *xpcs_regs; /* XPCS MMD registers */ 568c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 569c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Overall device lock */ 570c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas spinlock_t lock; 571c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 572c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* XPCS indirect addressing mutex */ 573c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct mutex xpcs_mutex; 574c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 575c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int irq_number; 576c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 577c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_hw_if hw_if; 578c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_desc_if desc_if; 579c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 580cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas /* AXI DMA settings */ 581cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas unsigned int axdomain; 582cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas unsigned int arcache; 583cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas unsigned int awcache; 584cfa50c7811fe3857fd882be96b2b2f130fa5da6dLendacky, Thomas 585c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Rings for Tx/Rx on a DMA channel */ 586c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_channel *channel; 587c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int channel_count; 588c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_ring_count; 589c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_desc_count; 590c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_ring_count; 591c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_desc_count; 592c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 593c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Tx/Rx common settings */ 594c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int pblx8; 595c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 596c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Tx settings */ 597c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_sf_mode; 598c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_threshold; 599c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_pbl; 600c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_osp_mode; 601c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 602c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Rx settings */ 603c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_sf_mode; 604c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_threshold; 605c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_pbl; 606c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 607c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Tx coalescing settings */ 608c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_usecs; 609c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_frames; 610c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 611c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Rx coalescing settings */ 612c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_riwt; 613c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_frames; 614c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 615c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Current MTU */ 616c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_buf_size; 617c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 618c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Flow control settings */ 619c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int pause_autoneg; 620c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int tx_pause; 621c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int rx_pause; 622c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 623c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* MDIO settings */ 624c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct module *phy_module; 625c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas char *mii_bus_id; 626c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct mii_bus *mii; 627c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int mdio_mmd; 628c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct phy_device *phydev; 629c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int default_autoneg; 630c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int default_speed; 631c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 632c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Current PHY settings */ 633c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas phy_interface_t phy_mode; 634c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int phy_link; 635c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas int phy_speed; 636c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int phy_tx_pause; 637c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int phy_rx_pause; 638c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 639c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Netdev related settings */ 640c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas netdev_features_t netdev_features; 641c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct napi_struct napi; 642c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_mmc_stats mmc_stats; 643c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 644801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas /* Filtering support */ 645801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 646801c62d945c6121c0262924732e430f0553bfb37Lendacky, Thomas 64723e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas /* Device clocks */ 64823e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct clk *sysclk; 64923e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct clk *ptpclk; 65023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas 65123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas /* Timestamp support */ 65223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas spinlock_t tstamp_lock; 65323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct ptp_clock_info ptp_clock_info; 65423e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct ptp_clock *ptp_clock; 65523e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct hwtstamp_config tstamp_config; 65623e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct cyclecounter tstamp_cc; 65723e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct timecounter tstamp_tc; 65823e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas unsigned int tstamp_addend; 65923e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct work_struct tx_tstamp_work; 66023e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas struct sk_buff *tx_tstamp_skb; 66123e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomas u64 tx_tstamp; 662c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 663c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Hardware features of the device */ 664c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct xgbe_hw_features hw_feat; 665c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 666c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Device restart work structure */ 667c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct work_struct restart_work; 668c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 669c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas /* Keeps track of power mode */ 670c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int power_down; 671c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 672c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#ifdef CONFIG_DEBUG_FS 673c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas struct dentry *xgbe_debugfs; 674c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 675c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int debugfs_xgmac_reg; 676c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 677c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int debugfs_xpcs_mmd; 678c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int debugfs_xpcs_reg; 679c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 680c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas}; 681c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 682c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* Function prototypes*/ 683c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 684c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_init_function_ptrs_dev(struct xgbe_hw_if *); 685c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_init_function_ptrs_desc(struct xgbe_desc_if *); 686c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct net_device_ops *xgbe_get_netdev_ops(void); 687c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstruct ethtool_ops *xgbe_get_ethtool_ops(void); 688c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 689c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasint xgbe_mdio_register(struct xgbe_prv_data *); 690c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_mdio_unregister(struct xgbe_prv_data *); 691c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_dump_phy_registers(struct xgbe_prv_data *); 69223e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomasvoid xgbe_ptp_register(struct xgbe_prv_data *); 69323e4eef7cf56b5e36e76af9078f0012826c86b2fLendacky, Thomasvoid xgbe_ptp_unregister(struct xgbe_prv_data *); 694c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_dump_tx_desc(struct xgbe_ring *, unsigned int, unsigned int, 695c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int); 696c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_dump_rx_desc(struct xgbe_ring *, struct xgbe_ring_desc *, 697c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas unsigned int); 698c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_print_pkt(struct net_device *, struct sk_buff *, bool); 699c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_get_all_hw_features(struct xgbe_prv_data *); 700c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasint xgbe_powerup(struct net_device *, unsigned int); 701c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasint xgbe_powerdown(struct net_device *, unsigned int); 702c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_init_rx_coalesce(struct xgbe_prv_data *); 703c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_init_tx_coalesce(struct xgbe_prv_data *); 704c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 705c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#ifdef CONFIG_DEBUG_FS 706c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_debugfs_init(struct xgbe_prv_data *); 707c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasvoid xgbe_debugfs_exit(struct xgbe_prv_data *); 708c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#else 709c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstatic inline void xgbe_debugfs_init(struct xgbe_prv_data *pdata) {} 710c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomasstatic inline void xgbe_debugfs_exit(struct xgbe_prv_data *pdata) {} 711c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif /* CONFIG_DEBUG_FS */ 712c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 713c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* NOTE: Uncomment for TX and RX DESCRIPTOR DUMP in KERNEL LOG */ 714c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#if 0 715c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_ENABLE_TX_DESC_DUMP 716c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_ENABLE_RX_DESC_DUMP 717c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 718c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 719c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* NOTE: Uncomment for TX and RX PACKET DUMP in KERNEL LOG */ 720c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#if 0 721c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_ENABLE_TX_PKT_DUMP 722c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define XGMAC_ENABLE_RX_PKT_DUMP 723c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 724c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 725c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* NOTE: Uncomment for function trace log messages in KERNEL LOG */ 726c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#if 0 727c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define YDEBUG 728c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define YDEBUG_MDIO 729c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 730c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 731c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas/* For debug prints */ 732c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#ifdef YDEBUG 733c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPR(x...) pr_alert(x) 734c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPHY_REGS(x...) xgbe_dump_phy_registers(x) 735c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#else 736c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPR(x...) do { } while (0) 737c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPHY_REGS(x...) do { } while (0) 738c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 739c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 740c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#ifdef YDEBUG_MDIO 741c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPR_MDIO(x...) pr_alert(x) 742c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#else 743c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#define DBGPR_MDIO(x...) do { } while (0) 744c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 745c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas 746c5aa9e3b815645e3aad08444c91ca6b237eeea01Lendacky, Thomas#endif 747