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