1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun ################################################################################ 4*4882a593Smuzhiyun # 5*4882a593Smuzhiyun # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6*4882a593Smuzhiyun # controllers with PCI-Express interface. 7*4882a593Smuzhiyun # 8*4882a593Smuzhiyun # Copyright(c) 2021 Realtek Semiconductor Corp. All rights reserved. 9*4882a593Smuzhiyun # 10*4882a593Smuzhiyun # This program is free software; you can redistribute it and/or modify it 11*4882a593Smuzhiyun # under the terms of the GNU General Public License as published by the Free 12*4882a593Smuzhiyun # Software Foundation; either version 2 of the License, or (at your option) 13*4882a593Smuzhiyun # any later version. 14*4882a593Smuzhiyun # 15*4882a593Smuzhiyun # This program is distributed in the hope that it will be useful, but WITHOUT 16*4882a593Smuzhiyun # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17*4882a593Smuzhiyun # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18*4882a593Smuzhiyun # more details. 19*4882a593Smuzhiyun # 20*4882a593Smuzhiyun # You should have received a copy of the GNU General Public License along with 21*4882a593Smuzhiyun # this program; if not, see <http://www.gnu.org/licenses/>. 22*4882a593Smuzhiyun # 23*4882a593Smuzhiyun # Author: 24*4882a593Smuzhiyun # Realtek NIC software team <nicfae@realtek.com> 25*4882a593Smuzhiyun # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26*4882a593Smuzhiyun # 27*4882a593Smuzhiyun ################################################################################ 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun /************************************************************************************ 31*4882a593Smuzhiyun * This product is covered by one or more of the following patents: 32*4882a593Smuzhiyun * US6,570,884, US6,115,776, and US6,327,625. 33*4882a593Smuzhiyun ***********************************************************************************/ 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun #ifndef _LINUX_RTLTOOL_H 36*4882a593Smuzhiyun #define _LINUX_RTLTOOL_H 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun #define SIOCRTLTOOL SIOCDEVPRIVATE+1 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun enum rtl_cmd { 41*4882a593Smuzhiyun RTLTOOL_READ_MAC=0, 42*4882a593Smuzhiyun RTLTOOL_WRITE_MAC, 43*4882a593Smuzhiyun RTLTOOL_READ_PHY, 44*4882a593Smuzhiyun RTLTOOL_WRITE_PHY, 45*4882a593Smuzhiyun RTLTOOL_READ_EPHY, 46*4882a593Smuzhiyun RTLTOOL_WRITE_EPHY, 47*4882a593Smuzhiyun RTLTOOL_READ_ERI, 48*4882a593Smuzhiyun RTLTOOL_WRITE_ERI, 49*4882a593Smuzhiyun RTLTOOL_READ_PCI, 50*4882a593Smuzhiyun RTLTOOL_WRITE_PCI, 51*4882a593Smuzhiyun RTLTOOL_READ_EEPROM, 52*4882a593Smuzhiyun RTLTOOL_WRITE_EEPROM, 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun RTL_READ_OOB_MAC, 55*4882a593Smuzhiyun RTL_WRITE_OOB_MAC, 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun RTL_ENABLE_PCI_DIAG, 58*4882a593Smuzhiyun RTL_DISABLE_PCI_DIAG, 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun RTL_READ_MAC_OCP, 61*4882a593Smuzhiyun RTL_WRITE_MAC_OCP, 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun RTL_DIRECT_READ_PHY_OCP, 64*4882a593Smuzhiyun RTL_DIRECT_WRITE_PHY_OCP, 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun RTLTOOL_INVALID 67*4882a593Smuzhiyun }; 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun struct rtltool_cmd { 70*4882a593Smuzhiyun __u32 cmd; 71*4882a593Smuzhiyun __u32 offset; 72*4882a593Smuzhiyun __u32 len; 73*4882a593Smuzhiyun __u32 data; 74*4882a593Smuzhiyun }; 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun enum mode_access { 77*4882a593Smuzhiyun MODE_NONE=0, 78*4882a593Smuzhiyun MODE_READ, 79*4882a593Smuzhiyun MODE_WRITE 80*4882a593Smuzhiyun }; 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun #ifdef __KERNEL__ 83*4882a593Smuzhiyun int rtl8168_tool_ioctl(struct rtl8168_private *tp, struct ifreq *ifr); 84*4882a593Smuzhiyun #endif 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun #endif /* _LINUX_RTLTOOL_H */ 87