Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / src / southbridge / via / vt8235 / vt8235_nic.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ops.h>
5 #include <device/pci_ids.h>
6
7 /*
8  * Enable the ethernet device and turn off stepping (because it is integrated
9  * inside the southbridge)
10  */
11 static void nic_init(struct device *dev)
12 {
13         uint8_t byte;
14
15         printk(BIOS_DEBUG, "Configuring VIA Rhine LAN\n");
16
17         /* We don't need stepping - though the device supports it */
18         byte = pci_read_config8(dev, PCI_COMMAND);
19         byte &= ~PCI_COMMAND_WAIT;
20         pci_write_config8(dev, PCI_COMMAND, byte);
21 }
22
23 static struct device_operations nic_ops = {
24         .read_resources   = pci_dev_read_resources,
25         .set_resources    = pci_dev_set_resources,
26         .enable_resources = pci_dev_enable_resources,
27         .init             = nic_init,
28         .enable           = 0,
29         .ops_pci          = 0,
30 };
31
32 static const struct pci_driver northbridge_driver __pci_driver = {
33         .ops    = &nic_ops,
34         .vendor = PCI_VENDOR_ID_VIA,
35         .device = PCI_DEVICE_ID_VIA_8233_7,
36 };