summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-02-19 04:58:34 +0000
committerdlg <dlg@openbsd.org>2015-02-19 04:58:34 +0000
commit3aa7367bff9030b75d355572d5cc8cdd74e3d1f3 (patch)
tree80bb23315af5db5816a469388b5b24df3b00a128
parentremove unused struct and #define (diff)
downloadwireguard-openbsd-3aa7367bff9030b75d355572d5cc8cdd74e3d1f3.tar.xz
wireguard-openbsd-3aa7367bff9030b75d355572d5cc8cdd74e3d1f3.zip
when reading the max packet size in the pcie device config and
status register, correctly mask things so we're left with the mps field instead of everything but the mps field. tested by bcallah@ and jim smith
-rw-r--r--sys/dev/pci/if_re_pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 8dd43c73a92..00700de277b 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.45 2015/01/26 09:58:47 brad Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.46 2015/02/19 04:58:34 dlg Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -182,7 +182,7 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
/* Set PCIe maximum read request size to 2048. */
reg = pci_conf_read(pa->pa_pc, pa->pa_tag,
sc->rl_expcap + PCI_PCIE_DCSR);
- reg = (reg & ~PCI_PCIE_DCSR_MPS);
+ reg &= PCI_PCIE_DCSR_MPS;
reg >>= 12;
rrs = (1 << (reg + 7));
if (rrs < 2048) {