blob: 51d4fcb0ab80e60a7638982b02077d5fc7e344bf [file] [log] [blame]
Angel Pons8a3453f2020-04-02 23:48:19 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Damien Zammite983f0c2016-05-21 02:24:19 +10002
3/*
Damien Zammitf5dd23f2016-12-01 23:29:34 +11004 * This driver resets the 10ec:8168 NIC then tries to read
5 * "macaddress" string XX:XX:XX:XX:XX:XX from CBFS.
6 * If no MAC is found, it programs a default MAC address in the device
Damien Zammite983f0c2016-05-21 02:24:19 +10007 * so that if the EEPROM/efuse is unconfigured it still has a default MAC.
8 */
9
Damien Zammitf5dd23f2016-12-01 23:29:34 +110010#include <cbfs.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -070011#include <acpi/acpi_device.h>
12#include <acpi/acpigen.h>
Damien Zammitf5dd23f2016-12-01 23:29:34 +110013#include <string.h>
Damien Zammite983f0c2016-05-21 02:24:19 +100014#include <arch/io.h>
Shelley Chen0528b612017-06-12 18:29:24 -070015#include <console/console.h>
Damien Zammite983f0c2016-05-21 02:24:19 +100016#include <device/device.h>
17#include <device/pci.h>
18#include <device/pci_ops.h>
19#include <device/pci_def.h>
Alan Huang769994c2021-11-10 10:59:13 +080020#include <device/pci_ids.h>
Damien Zammite983f0c2016-05-21 02:24:19 +100021#include <delay.h>
Shelley Chen0528b612017-06-12 18:29:24 -070022#include <fmap.h>
Elyes HAOUASbd1683d2019-05-15 21:05:37 +020023#include <types.h>
24
Gaggery Tsai65623ef2017-09-29 11:15:23 +080025#include "chip.h"
Damien Zammite983f0c2016-05-21 02:24:19 +100026
27#define NIC_TIMEOUT 1000
28
29#define CMD_REG 0x37
30#define CMD_REG_RESET 0x10
Gaggery Tsai65623ef2017-09-29 11:15:23 +080031#define CMD_LED0_LED1 0x18
Rory Liu2b1e7372021-11-22 10:42:25 +080032#define CMD_LED_FEATURE 0x94
33#define CMD_LEDSEL0 0x18
34#define CMD_LEDSEL2 0x84
Damien Zammite983f0c2016-05-21 02:24:19 +100035
36#define CFG_9346 0x50
37#define CFG_9346_LOCK 0x00
38#define CFG_9346_UNLOCK 0xc0
39
Gaggery Tsai1f847042017-12-26 17:13:52 +080040#define DEVICE_INDEX_BYTE 12
41#define MAX_DEVICE_SUPPORT 10
Shelley Chen0528b612017-06-12 18:29:24 -070042/**
43 * search: Find first instance of string in a given region
44 * @param p string to find
45 * @param a start address of region to search
46 * @param lengthp length of string to search for
47 * @param lengtha length of region to search in
48 * @return offset offset from start address a where string was found.
49 * If string not found, return lengtha.
50 */
51static size_t search(const char *p, const u8 *a, size_t lengthp,
52 size_t lengtha)
53{
54 size_t i, j;
55
56 if (lengtha < lengthp)
57 return lengtha;
58 /* Searching */
59 for (j = 0; j <= lengtha - lengthp; j++) {
60 for (i = 0; i < lengthp && p[i] == a[i + j]; i++)
61 ;
David Wu9a0d9e02018-05-04 15:37:37 +080062 if (i >= lengthp && a[j - 1] == lengthp)
Shelley Chen0528b612017-06-12 18:29:24 -070063 return j;
64 }
65 return lengtha;
66}
67
Damien Zammitf5dd23f2016-12-01 23:29:34 +110068static u8 get_hex_digit(const u8 c)
Damien Zammite983f0c2016-05-21 02:24:19 +100069{
Damien Zammitf5dd23f2016-12-01 23:29:34 +110070 u8 ret = 0;
Damien Zammite983f0c2016-05-21 02:24:19 +100071
Damien Zammitf5dd23f2016-12-01 23:29:34 +110072 ret = c - '0';
73 if (ret > 0x09) {
74 ret = c - 'A' + 0x0a;
75 if (ret > 0x0f)
76 ret = c - 'a' + 0x0a;
77 }
78 if (ret > 0x0f) {
Julius Wernere9665952022-01-21 17:06:20 -080079 printk(BIOS_ERR, "Invalid hex digit found: "
Shelley Chen0528b612017-06-12 18:29:24 -070080 "%c - 0x%02x\n", (char)c, c);
Damien Zammitf5dd23f2016-12-01 23:29:34 +110081 ret = 0;
82 }
83 return ret;
84}
Damien Zammite983f0c2016-05-21 02:24:19 +100085
Shelley Chen0528b612017-06-12 18:29:24 -070086#define MACLEN 17
87
Edward O'Callaghan2a82f742020-03-25 12:52:50 +110088/* Returns MAC address based on the key that is passed in. */
89static enum cb_err fetch_mac_vpd_key(u8 *macstrbuf, const char *vpd_key)
Shelley Chen0528b612017-06-12 18:29:24 -070090{
91 struct region_device rdev;
92 void *search_address;
93 size_t search_length;
94 size_t offset;
Edward O'Callaghan2a82f742020-03-25 12:52:50 +110095
96 if (fmap_locate_area_as_rdev("RO_VPD", &rdev)) {
Julius Wernere9665952022-01-21 17:06:20 -080097 printk(BIOS_ERR, "Couldn't find RO_VPD region.");
Edward O'Callaghan2a82f742020-03-25 12:52:50 +110098 return CB_ERR;
99 }
100 search_address = rdev_mmap_full(&rdev);
101 if (search_address == NULL) {
102 printk(BIOS_ERR, "LAN: VPD not found.\n");
103 return CB_ERR;
104 }
105
106 search_length = region_device_sz(&rdev);
107 offset = search(vpd_key, search_address, strlen(vpd_key),
108 search_length);
109
110 if (offset == search_length) {
Julius Wernere9665952022-01-21 17:06:20 -0800111 printk(BIOS_ERR, "Could not locate '%s' in VPD\n", vpd_key);
Edward O'Callaghand08bc5a2020-03-26 14:37:37 +1100112 rdev_munmap(&rdev, search_address);
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100113 return CB_ERR;
114 }
115 printk(BIOS_DEBUG, "Located '%s' in VPD\n", vpd_key);
116
117 offset += strlen(vpd_key) + 1; /* move to next character */
118
119 if (offset + MACLEN > search_length) {
Edward O'Callaghand08bc5a2020-03-26 14:37:37 +1100120 rdev_munmap(&rdev, search_address);
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100121 printk(BIOS_ERR, "Search result too small!\n");
122 return CB_ERR;
123 }
124 memcpy(macstrbuf, search_address + offset, MACLEN);
Edward O'Callaghand08bc5a2020-03-26 14:37:37 +1100125 rdev_munmap(&rdev, search_address);
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100126
127 return CB_SUCCESS;
128}
129
130/* Prepares vpd_key by concatenating ethernet_mac with device_index */
131static enum cb_err fetch_mac_vpd_dev_idx(u8 *macstrbuf, u8 device_index)
132{
Gaggery Tsai1f847042017-12-26 17:13:52 +0800133 char key[] = "ethernet_mac "; /* Leave a space at tail to stuff an index */
134
135 /*
Edward O'Callaghan0e138062020-03-23 13:06:42 +1100136 * Map each NIC on the DUT to "ethernet_macN", where N is [0-9].
137 * Translate index number from integer to ascii by adding '0' char.
Gaggery Tsai1f847042017-12-26 17:13:52 +0800138 */
Edward O'Callaghan0e138062020-03-23 13:06:42 +1100139 key[DEVICE_INDEX_BYTE] = device_index + '0';
Shelley Chen0528b612017-06-12 18:29:24 -0700140
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100141 return fetch_mac_vpd_key(macstrbuf, key);
142}
143
144static void fetch_mac_string_vpd(struct drivers_net_config *config, u8 *macstrbuf)
145{
146 if (!config)
147 return;
148
149 /* Current implementation is up to 10 NIC cards */
150 if (config->device_index > MAX_DEVICE_SUPPORT) {
151 printk(BIOS_ERR, "r8168: the maximum device_index should be less then %d\n."
152 " Using default 00:e0:4c:00:c0:b0\n", MAX_DEVICE_SUPPORT);
153 return;
Shelley Chen0528b612017-06-12 18:29:24 -0700154 }
155
Edward O'Callaghan0e138062020-03-23 13:06:42 +1100156 if (fetch_mac_vpd_dev_idx(macstrbuf, config->device_index) == CB_SUCCESS)
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100157 return;
Gaggery Tsai1f847042017-12-26 17:13:52 +0800158
Edward O'Callaghan0e138062020-03-23 13:06:42 +1100159 if (!CONFIG(RT8168_SUPPORT_LEGACY_VPD_MAC)) {
160 printk(BIOS_ERR, "r8168: mac address not found in VPD,"
161 " using default 00:e0:4c:00:c0:b0\n");
162 return;
163 }
164
Edward O'Callaghan2a0a02f2020-03-26 16:47:55 +1100165 if (fetch_mac_vpd_key(macstrbuf, "ethernet_mac") != CB_SUCCESS)
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100166 printk(BIOS_ERR, "r8168: mac address not found in VPD,"
167 " using default 00:e0:4c:00:c0:b0\n");
Shelley Chen0528b612017-06-12 18:29:24 -0700168}
169
170static enum cb_err fetch_mac_string_cbfs(u8 *macstrbuf)
171{
Julius Werner77639e42021-02-05 16:51:25 -0800172 if (!cbfs_load("rt8168-macaddress", macstrbuf, MACLEN)) {
173 printk(BIOS_ERR, "r8168: Error reading MAC from CBFS\n");
174 return CB_ERR;
Shelley Chen0528b612017-06-12 18:29:24 -0700175 }
Julius Werner77639e42021-02-05 16:51:25 -0800176 return CB_SUCCESS;
Shelley Chen0528b612017-06-12 18:29:24 -0700177}
178
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100179static void get_mac_address(u8 *macaddr, const u8 *strbuf)
180{
181 size_t offset = 0;
182 int i;
183
Shelley Chen0528b612017-06-12 18:29:24 -0700184 if ((strbuf[2] != ':') || (strbuf[5] != ':') ||
185 (strbuf[8] != ':') || (strbuf[11] != ':') ||
186 (strbuf[14] != ':')) {
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100187 printk(BIOS_ERR, "r8168: ignore invalid MAC address in cbfs\n");
188 return;
189 }
190
191 for (i = 0; i < 6; i++) {
192 macaddr[i] = 0;
193 macaddr[i] |= get_hex_digit(strbuf[offset]) << 4;
194 macaddr[i] |= get_hex_digit(strbuf[offset + 1]);
195 offset += 3;
196 }
197}
198
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100199static void program_mac_address(struct device *dev, u16 io_base)
200{
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100201 u8 macstrbuf[MACLEN] = { 0 };
202 int i = 0;
Shelley Chen0528b612017-06-12 18:29:24 -0700203 /* Default MAC Address of 00:E0:4C:00:C0:B0 */
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100204 u8 mac[6] = { 0x00, 0xe0, 0x4c, 0x00, 0xc0, 0xb0 };
Gaggery Tsai1f847042017-12-26 17:13:52 +0800205 struct drivers_net_config *config = dev->chip_info;
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100206
Shelley Chen0528b612017-06-12 18:29:24 -0700207 /* check the VPD for the mac address */
Julius Wernercd49cce2019-03-05 16:53:33 -0800208 if (CONFIG(RT8168_GET_MAC_FROM_VPD)) {
Edward O'Callaghan2a82f742020-03-25 12:52:50 +1100209 fetch_mac_string_vpd(config, macstrbuf);
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100210 } else {
Shelley Chen0528b612017-06-12 18:29:24 -0700211 if (fetch_mac_string_cbfs(macstrbuf) != CB_SUCCESS)
212 printk(BIOS_ERR, "r8168: Error reading MAC from CBFS,"
Gaggery Tsai1f847042017-12-26 17:13:52 +0800213 " using default 00:e0:4c:00:c0:b0\n");
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100214 }
Shelley Chen0528b612017-06-12 18:29:24 -0700215 get_mac_address(mac, macstrbuf);
Damien Zammite983f0c2016-05-21 02:24:19 +1000216
217 /* Reset NIC */
218 printk(BIOS_DEBUG, "r8168: Resetting NIC...");
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100219 outb(CMD_REG_RESET, io_base + CMD_REG);
Damien Zammite983f0c2016-05-21 02:24:19 +1000220
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100221 /* Poll for reset, with 1sec timeout */
222 while (i < NIC_TIMEOUT && (inb(io_base + CMD_REG) & CMD_REG_RESET)) {
Damien Zammite983f0c2016-05-21 02:24:19 +1000223 udelay(1000);
224 if (++i >= NIC_TIMEOUT)
Shelley Chen0528b612017-06-12 18:29:24 -0700225 printk(BIOS_ERR, "timeout waiting for nic to reset\n");
Damien Zammite983f0c2016-05-21 02:24:19 +1000226 }
227 if (i < NIC_TIMEOUT)
228 printk(BIOS_DEBUG, "done\n");
229
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100230 printk(BIOS_DEBUG, "r8168: Programming MAC Address...");
Damien Zammite983f0c2016-05-21 02:24:19 +1000231
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100232 /* Disable register protection */
233 outb(CFG_9346_UNLOCK, io_base + CFG_9346);
Damien Zammite983f0c2016-05-21 02:24:19 +1000234
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100235 /* Set MAC address: only 4-byte write accesses allowed */
236 outl(mac[4] | mac[5] << 8, io_base + 4);
237 inl(io_base + 4);
238 outl(mac[0] | mac[1] << 8 | mac[2] << 16 | mac[3] << 24,
239 io_base);
240 inl(io_base);
Damien Zammite983f0c2016-05-21 02:24:19 +1000241 /* Lock config regs */
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100242 outb(CFG_9346_LOCK, io_base + CFG_9346);
243
244 printk(BIOS_DEBUG, "done\n");
245}
246
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800247static void r8168_set_customized_led(struct device *dev, u16 io_base)
248{
249 struct drivers_net_config *config = dev->chip_info;
250
251 if (!config)
252 return;
253
Rory Liu2b1e7372021-11-22 10:42:25 +0800254 if (dev->device == PCI_DEVICE_ID_REALTEK_8125) {
255 /* Set LED global Feature register */
256 outb(config->led_feature, io_base + CMD_LED_FEATURE);
257 printk(BIOS_DEBUG, "r8125: read back LED global feature setting as 0x%x\n",
258 inb(io_base + CMD_LED_FEATURE));
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800259
Rory Liu2b1e7372021-11-22 10:42:25 +0800260 /*
261 * Refer to RTL8125 datasheet 5.Customizable LED Configuration
262 * Register Name IO Address
263 * LEDSEL0 0x18
264 * LEDSEL2 0x84
265 * LEDFEATURE 0x94
266 *
267 * LEDSEL Bit[] Description
268 * Bit0 Link10M
269 * Bit1 Link100M
270 * Bit3 Link1000M
271 * Bit5 Link2.5G
272 * Bit9 ACT
273 * Bit10 preboot enable
274 * Bit11 lp enable
275 * Bit12 active low/high
276 *
277 * LEDFEATURE Description
278 * Bit0 LED Table V1/V2
279 * Bit1~3 Reserved
280 * Bit4~5 LED Blinking Duty Cycle 12.5%/ 25%/ 50%/ 75%
281 * Bit6~7 LED Blinking Freq. 240ms/160ms/80ms/Link-Speed-Dependent
282 */
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800283
Rory Liu2b1e7372021-11-22 10:42:25 +0800284 /* Set customized LED0 register */
285 outw(config->customized_led0, io_base + CMD_LEDSEL0);
286 printk(BIOS_DEBUG, "r8125: read back LED0 setting as 0x%x\n",
287 inw(io_base + CMD_LEDSEL0));
288
289 /* Set customized LED2 register */
290 outw(config->customized_led2, io_base + CMD_LEDSEL2);
291 printk(BIOS_DEBUG, "r8125: read back LED2 setting as 0x%x\n",
292 inw(io_base + CMD_LEDSEL2));
293 } else {
294 /* Read the customized LED setting from devicetree */
295 printk(BIOS_DEBUG, "r8168: Customized LED 0x%x\n", config->customized_leds);
296
297 /*
298 * Refer to RTL8111H datasheet 7.2 Customizable LED Configuration
299 * Starting from offset 0x18
300 * Bit[15:12] LED Feature Control(FC)
301 * Bit[11:08] LED Select for PINLED2
302 * Bit[07:04] LED Select for PINLED1
303 * Bit[03:00] LED Select for PINLED0
304 *
305 * Speed Link10M Link100M Link1000M ACT/Full
306 * LED0 Bit0 Bit1 Bit2 Bit3
307 * LED1 Bit4 Bit5 Bit6 Bit7
308 * LED2 Bit8 Bit9 Bit10 Bit11
309 * FC Bit12 Bit13 Bit14 Bit15
310 */
311
312 /* Set customized LED registers */
313 outw(config->customized_leds, io_base + CMD_LED0_LED1);
314 printk(BIOS_DEBUG, "r8168: read back LED setting as 0x%x\n",
315 inw(io_base + CMD_LED0_LED1));
316 }
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800317}
318
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100319static void r8168_init(struct device *dev)
320{
321 /* Get the resource of the NIC mmio */
322 struct resource *nic_res = find_resource(dev, PCI_BASE_ADDRESS_0);
323 u16 io_base = (u16)nic_res->base;
324
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800325 /* Check if the base is invalid */
326 if (!io_base) {
Martin Roth0949e732021-10-01 14:28:22 -0600327 printk(BIOS_ERR, "r8168: Error can't find IO resource\n");
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800328 return;
329 }
Damien Zammitf5dd23f2016-12-01 23:29:34 +1100330 /* Enable but do not set bus master */
331 pci_write_config16(dev, PCI_COMMAND,
332 PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
333
334 /* Program MAC address based on CBFS "macaddress" containing
335 * a string AA:BB:CC:DD:EE:FF */
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800336 program_mac_address(dev, io_base);
337
338 /* Program customized LED mode */
Julius Wernercd49cce2019-03-05 16:53:33 -0800339 if (CONFIG(RT8168_SET_LED_MODE))
Gaggery Tsai65623ef2017-09-29 11:15:23 +0800340 r8168_set_customized_led(dev, io_base);
Damien Zammite983f0c2016-05-21 02:24:19 +1000341}
342
Julius Wernercd49cce2019-03-05 16:53:33 -0800343#if CONFIG(HAVE_ACPI_TABLES)
Gaggery Tsai6919a932017-11-16 17:21:23 +0800344#define R8168_ACPI_HID "R8168"
Furquan Shaikh7536a392020-04-24 21:59:21 -0700345static void r8168_net_fill_ssdt(const struct device *dev)
Gaggery Tsai6919a932017-11-16 17:21:23 +0800346{
347 struct drivers_net_config *config = dev->chip_info;
348 const char *path = acpi_device_path(dev->bus->dev);
349 u32 address;
350
351 if (!path || !config)
352 return;
353
354 /* Device */
355 acpigen_write_scope(path);
356 acpigen_write_device(acpi_device_name(dev));
357 acpigen_write_name_string("_HID", R8168_ACPI_HID);
Patrick Rudolphc83bab62019-12-13 12:16:06 +0100358 acpi_device_write_uid(dev);
359
Gaggery Tsai6919a932017-11-16 17:21:23 +0800360 if (dev->chip_ops)
361 acpigen_write_name_string("_DDN", dev->chip_ops->name);
362
Edward O'Callaghanb765fa62020-01-21 21:01:32 +1100363 /* Power Resource */
Arthur Heymans59a348b2021-10-27 18:27:58 +0200364 if (CONFIG(RT8168_GEN_ACPI_POWER_RESOURCE) && config->has_power_resource) {
Edward O'Callaghanb765fa62020-01-21 21:01:32 +1100365 const struct acpi_power_res_params power_res_params = {
366 .stop_gpio = &config->stop_gpio,
367 .stop_delay_ms = config->stop_delay_ms,
368 .stop_off_delay_ms = config->stop_off_delay_ms
369 };
370 acpi_device_add_power_res(&power_res_params);
371 }
372
Gaggery Tsai6919a932017-11-16 17:21:23 +0800373 /* Address */
374 address = PCI_SLOT(dev->path.pci.devfn) & 0xffff;
375 address <<= 16;
376 address |= PCI_FUNC(dev->path.pci.devfn) & 0xffff;
377 acpigen_write_name_dword("_ADR", address);
378
379 /* Wake capabilities */
380 if (config->wake)
381 acpigen_write_PRW(config->wake, 3);
382
383 acpigen_pop_len(); /* Device */
384 acpigen_pop_len(); /* Scope */
385
386 printk(BIOS_INFO, "%s.%s: %s %s\n", path, acpi_device_name(dev),
387 dev->chip_ops ? dev->chip_ops->name : "", dev_path(dev));
388}
389
390static const char *r8168_net_acpi_name(const struct device *dev)
391{
392 return "RLTK";
393}
394#endif
395
Damien Zammite983f0c2016-05-21 02:24:19 +1000396static struct device_operations r8168_ops = {
Martin Rothb9810a42017-07-23 20:00:04 -0600397 .read_resources = pci_dev_read_resources,
398 .set_resources = pci_dev_set_resources,
399 .enable_resources = pci_dev_enable_resources,
400 .init = r8168_init,
Julius Wernercd49cce2019-03-05 16:53:33 -0800401#if CONFIG(HAVE_ACPI_TABLES)
Nico Huber68680dd2020-03-31 17:34:52 +0200402 .acpi_name = r8168_net_acpi_name,
403 .acpi_fill_ssdt = r8168_net_fill_ssdt,
Gaggery Tsai6919a932017-11-16 17:21:23 +0800404#endif
Damien Zammite983f0c2016-05-21 02:24:19 +1000405};
406
Alan Huang769994c2021-11-10 10:59:13 +0800407static const unsigned short pci_device_ids[] = {
408 PCI_DEVICE_ID_REALTEK_8168,
409 PCI_DEVICE_ID_REALTEK_8125,
410 0
411};
412
Damien Zammite983f0c2016-05-21 02:24:19 +1000413static const struct pci_driver r8168_driver __pci_driver = {
Martin Rothb9810a42017-07-23 20:00:04 -0600414 .ops = &r8168_ops,
Alan Huang769994c2021-11-10 10:59:13 +0800415 .vendor = PCI_VENDOR_ID_REALTEK,
416 .devices = pci_device_ids,
Damien Zammite983f0c2016-05-21 02:24:19 +1000417};
Gaggery Tsai6919a932017-11-16 17:21:23 +0800418
419struct chip_operations drivers_net_ops = {
420 CHIP_NAME("Realtek r8168")
421};