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 //EEPROM opcodes 36 #define RTL_EEPROM_READ_OPCODE 06 37 #define RTL_EEPROM_WRITE_OPCODE 05 38 #define RTL_EEPROM_ERASE_OPCODE 07 39 #define RTL_EEPROM_EWEN_OPCODE 19 40 #define RTL_EEPROM_EWDS_OPCODE 16 41 42 #define RTL_CLOCK_RATE 3 43 44 void rtl8168_eeprom_type(struct rtl8168_private *tp); 45 void rtl8168_eeprom_cleanup(struct rtl8168_private *tp); 46 u16 rtl8168_eeprom_read_sc(struct rtl8168_private *tp, u16 reg); 47 void rtl8168_eeprom_write_sc(struct rtl8168_private *tp, u16 reg, u16 data); 48 void rtl8168_shift_out_bits(struct rtl8168_private *tp, int data, int count); 49 u16 rtl8168_shift_in_bits(struct rtl8168_private *tp); 50 void rtl8168_raise_clock(struct rtl8168_private *tp, u8 *x); 51 void rtl8168_lower_clock(struct rtl8168_private *tp, u8 *x); 52 void rtl8168_stand_by(struct rtl8168_private *tp); 53 void rtl8168_set_eeprom_sel_low(struct rtl8168_private *tp); 54 55 56 57