Module Name: src
Committed By: msaitoh
Date: Wed Feb 13 16:58:04 UTC 2013
Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h
Log Message:
No functional change.
- Fix comment.
- Use macro.
To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_wmreg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.244 src/sys/dev/pci/if_wm.c:1.245
--- src/sys/dev/pci/if_wm.c:1.244 Wed Feb 13 12:28:23 2013
+++ src/sys/dev/pci/if_wm.c Wed Feb 13 16:58:04 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.244 2013/02/13 12:28:23 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.245 2013/02/13 16:58:04 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.244 2013/02/13 12:28:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.245 2013/02/13 16:58:04 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -6306,7 +6306,7 @@ wm_gmii_mediainit(struct wm_softc *sc, p
break;
case PCI_PRODUCT_INTEL_PCH2_LV_LM:
case PCI_PRODUCT_INTEL_PCH2_LV_V:
- /* 82578 */
+ /* 82579 */
sc->sc_phytype = WMPHY_82579;
mii->mii_readreg = wm_gmii_hv_readreg;
mii->mii_writereg = wm_gmii_hv_writereg;
@@ -6771,7 +6771,7 @@ wm_gmii_bm_readreg(device_t self, int ph
if (reg > BME1000_MAX_MULTI_PAGE_REG) {
if (phy == 1)
- wm_gmii_i82544_writereg(self, phy, 0x1f,
+ wm_gmii_i82544_writereg(self, phy, MII_IGPHY_PAGE_SELECT,
reg);
else
wm_gmii_i82544_writereg(self, phy,
@@ -6806,7 +6806,7 @@ wm_gmii_bm_writereg(device_t self, int p
if (reg > BME1000_MAX_MULTI_PAGE_REG) {
if (phy == 1)
- wm_gmii_i82544_writereg(self, phy, 0x1f,
+ wm_gmii_i82544_writereg(self, phy, MII_IGPHY_PAGE_SELECT,
reg);
else
wm_gmii_i82544_writereg(self, phy,
@@ -7385,14 +7385,15 @@ wm_valid_nvm_bank_detect_ich8lan(struct
/* Value of bit 22 corresponds to the flash bank we're on. */
*bank = (CSR_READ(sc, WMREG_EECD) & EECD_SEC1VAL) ? 1 : 0;
} else {
- uint8_t bank_high_byte;
- wm_read_ich8_byte(sc, act_offset, &bank_high_byte);
- if ((bank_high_byte & 0xc0) == 0x80)
+ uint8_t sig_byte;
+ wm_read_ich8_byte(sc, act_offset, &sig_byte);
+ if ((sig_byte & ICH_NVM_VALID_SIG_MASK) == ICH_NVM_SIG_VALUE)
*bank = 0;
else {
wm_read_ich8_byte(sc, act_offset + bank1_offset,
- &bank_high_byte);
- if ((bank_high_byte & 0xc0) == 0x80)
+ &sig_byte);
+ if ((sig_byte & ICH_NVM_VALID_SIG_MASK)
+ == ICH_NVM_SIG_VALUE)
*bank = 1;
else {
aprint_error_dev(sc->sc_dev,
Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.49 src/sys/dev/pci/if_wmreg.h:1.50
--- src/sys/dev/pci/if_wmreg.h:1.49 Thu Feb 7 15:38:42 2013
+++ src/sys/dev/pci/if_wmreg.h Wed Feb 13 16:58:04 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wmreg.h,v 1.49 2013/02/07 15:38:42 msaitoh Exp $ */
+/* $NetBSD: if_wmreg.h,v 1.50 2013/02/13 16:58:04 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -255,6 +255,7 @@ struct livengood_tcpip_ctxdesc {
#define EECD_EE_TYPE (1U << 13) /* EEPROM type
(0 = Microwire, 1 = SPI) */
#define EECD_SEC1VAL (1U << 22) /* Sector One Valid */
+#define EECD_SEC1VAL_VALMASK (EECD_EE_AUTORD | EECD_EE_PRES) /* Valid Mask */
#define UWIRE_OPC_ERASE 0x04 /* MicroWire "erase" opcode */
#define UWIRE_OPC_WRITE 0x05 /* MicroWire "write" opcode */
@@ -963,6 +964,8 @@ struct livengood_tcpip_ctxdesc {
#define ICH_NVM_SIG_WORD 0x13
#define ICH_NVM_SIG_MASK 0xc000
+#define ICH_NVM_VALID_SIG_MASK 0xc0
+#define ICH_NVM_SIG_VALUE 0x80
/* for PCI express Capability registers */
#define WM_PCI_PCIE_DCSR2_16MS 0x00000005