summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2011-10-19 07:29:43 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2011-10-19 07:29:43 +0000
commitd29b27709ede8e1f12607e6f998c4e6d6a681a50 (patch)
tree0767e314b2755390db7bf5828111208a316b4776 /sys
parent66def1a1b1d07d7fa44ff8002bd53fcc148ce577 (diff)
A missing part of an if statement meant we were writing out
garbage when changing snoop related registers on pch2. Rework the code to remove the duplication and hopefully make this sort of thing less likely in future. Found and debugged by pedro. ok markus@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em_hw.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/pci/if_em_hw.c b/sys/dev/pci/if_em_hw.c
index f73af64cd58..61ae3c9bbd3 100644
--- a/sys/dev/pci/if_em_hw.c
+++ b/sys/dev/pci/if_em_hw.c
@@ -31,7 +31,7 @@
*******************************************************************************/
-/* $OpenBSD: if_em_hw.c,v 1.66 2011/10/05 02:52:10 jsg Exp $ */
+/* $OpenBSD: if_em_hw.c,v 1.67 2011/10/19 07:29:42 jsg Exp $ */
/*
* if_em_hw.c Shared functions for accessing and configuring the MAC
*/
@@ -1374,18 +1374,18 @@ em_init_hw(struct em_hw *hw)
* ICH8 No-snoop bits are opposite polarity. Set to snoop by default
* after reset.
*/
- if (hw->mac_type == em_ich8lan)
- snoop = PCI_EX_82566_SNOOP_ALL;
- else if (hw->mac_type == em_ich9lan ||
- hw->mac_type == em_ich10lan ||
- hw->mac_type == em_pchlan)
- snoop = (u_int32_t) ~ (PCI_EX_NO_SNOOP_ALL);
if (hw->mac_type == em_ich8lan ||
hw->mac_type == em_ich9lan ||
hw->mac_type == em_ich10lan ||
hw->mac_type == em_pchlan ||
- hw->mac_type == em_pch2lan)
+ hw->mac_type == em_pch2lan) {
+ if (hw->mac_type == em_ich8lan)
+ snoop = PCI_EX_82566_SNOOP_ALL;
+ else
+ snoop = (u_int32_t) ~ (PCI_EX_NO_SNOOP_ALL);
+
em_set_pci_ex_no_snoop(hw, snoop);
+ }
if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER ||
hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) {