Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev No functional change:
details: https://anonhg.NetBSD.org/src/rev/80252c76c369
branches: trunk
changeset: 329850:80252c76c369
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jun 12 12:09:47 2014 +0000
description:
No functional change:
- Remove BRGPHY_SERDES_ANAR_* and BRGPHY_SERDES_ANLPAR_*. Those registers
are the same as MII_ANAR_* and MII_ANLPAR_*.
- Fix typo.
- Remove trailing white spaces.
- KNF.
diffstat:
sys/dev/mii/brgphy.c | 12 +--
sys/dev/mii/brgphyreg.h | 21 +-------
sys/dev/pci/if_bnx.c | 127 +++++++++++++++++++++++------------------------
3 files changed, 67 insertions(+), 93 deletions(-)
diffs (truncated from 562 to 300 lines):
diff -r 58e4c6667f7f -r 80252c76c369 sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c Thu Jun 12 08:50:52 2014 +0000
+++ b/sys/dev/mii/brgphy.c Thu Jun 12 12:09:47 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphy.c,v 1.68 2013/10/31 04:26:40 msaitoh Exp $ */
+/* $NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.68 2013/10/31 04:26:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -376,9 +376,8 @@
if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) {
speed |= BMCR_FDX;
gig = GTCR_ADV_1000TFDX;
- } else {
+ } else
gig = GTCR_ADV_1000THDX;
- }
PHY_WRITE(sc, MII_100T2CR, 0);
PHY_WRITE(sc, MII_ANAR, ANAR_CSMA);
@@ -635,7 +634,7 @@
if (sc->mii_flags & MIIF_HAVEFIBER) {
anar = ANAR_X_FD | ANAR_X_HD;
if (sc->mii_flags & MIIF_DOPAUSE)
- anar |= BRGPHY_SERDES_ANAR_BOTH_PAUSE;
+ anar |= ANAR_X_PAUSE_TOWARDS;
} else {
anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA;
if (sc->mii_flags & MIIF_DOPAUSE)
@@ -645,8 +644,7 @@
DELAY(1000);
/* Start autonegotiation */
- PHY_WRITE(sc, MII_BMCR,
- BMCR_AUTOEN | BMCR_STARTNEG);
+ PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00);
return (EJUSTRETURN);
diff -r 58e4c6667f7f -r 80252c76c369 sys/dev/mii/brgphyreg.h
--- a/sys/dev/mii/brgphyreg.h Thu Jun 12 08:50:52 2014 +0000
+++ b/sys/dev/mii/brgphyreg.h Thu Jun 12 12:09:47 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphyreg.h,v 1.6 2013/04/01 13:44:02 msaitoh Exp $ */
+/* $NetBSD: brgphyreg.h,v 1.7 2014/06/12 12:09:47 msaitoh Exp $ */
/*
* Copyright (c) 2000
@@ -197,25 +197,6 @@
#define BRGPHY_IMR_CRCERR 0x0001 /* CEC error */
/*******************************************************/
-/* Begin: Shared SerDes PHY register definitions */
-/*******************************************************/
-
-/* SerDes autoneg is different from copper */
-#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7)
-#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7)
-#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7)
-#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7)
-
-#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7)
-#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7)
-#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7)
-#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7)
-
-/*******************************************************/
-/* End: Shared SerDes PHY register definitions */
-/*******************************************************/
-
-/*******************************************************/
/* Begin: PHY register values for the 5706 PHY */
/*******************************************************/
diff -r 58e4c6667f7f -r 80252c76c369 sys/dev/pci/if_bnx.c
--- a/sys/dev/pci/if_bnx.c Thu Jun 12 08:50:52 2014 +0000
+++ b/sys/dev/pci/if_bnx.c Thu Jun 12 12:09:47 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bnx.c,v 1.51 2014/03/29 19:28:24 christos Exp $ */
+/* $NetBSD: if_bnx.c,v 1.52 2014/06/12 12:09:47 msaitoh Exp $ */
/* $OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */
/*-
@@ -35,7 +35,7 @@
#if 0
__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
#endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.51 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.52 2014/06/12 12:09:47 msaitoh Exp $");
/*
* The following controllers are supported by this driver:
@@ -440,9 +440,9 @@
struct pci_attach_args *pa = (struct pci_attach_args *)aux;
if (bnx_lookup(pa) != NULL)
- return (1);
-
- return (0);
+ return 1;
+
+ return 0;
}
/****************************************************************************/
@@ -508,7 +508,7 @@
return;
}
- memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, BNX_PCI_BAR0);
+ memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, BNX_PCI_BAR0);
if (pci_mapreg_map(pa, BNX_PCI_BAR0, memtype, 0, &sc->bnx_btag,
&sc->bnx_bhandle, NULL, &sc->bnx_size)) {
aprint_error_dev(sc->bnx_dev, "can't find mem space\n");
@@ -739,12 +739,9 @@
aprint_error_dev(self, "no PHY found!\n");
ifmedia_add(&sc->bnx_mii.mii_media,
IFM_ETHER|IFM_MANUAL, 0, NULL);
- ifmedia_set(&sc->bnx_mii.mii_media,
- IFM_ETHER|IFM_MANUAL);
- } else {
- ifmedia_set(&sc->bnx_mii.mii_media,
- IFM_ETHER|IFM_AUTO);
- }
+ ifmedia_set(&sc->bnx_mii.mii_media, IFM_ETHER | IFM_MANUAL);
+ } else
+ ifmedia_set(&sc->bnx_mii.mii_media, IFM_ETHER | IFM_AUTO);
/* Attach to the Ethernet interface list. */
if_attach(ifp);
@@ -820,7 +817,7 @@
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
- return(0);
+ return 0;
}
/****************************************************************************/
@@ -847,7 +844,7 @@
BNX_PCICFG_REG_WINDOW);
DBPRINT(sc, BNX_EXCESSIVE, "%s(); offset = 0x%08X, "
"val = 0x%08X\n", __func__, offset, val);
- return (val);
+ return val;
}
#else
return pci_conf_read(pa->pa_pc, pa->pa_tag, BNX_PCICFG_REG_WINDOW);
@@ -937,7 +934,7 @@
if (phy != sc->bnx_phy_addr) {
DBPRINT(sc, BNX_VERBOSE,
"Invalid PHY address %d for PHY read!\n", phy);
- return(0);
+ return 0;
}
/*
@@ -1173,10 +1170,10 @@
if (j >= NVRAM_TIMEOUT_COUNT) {
DBPRINT(sc, BNX_WARN, "Timeout acquiring NVRAM lock!\n");
- return (EBUSY);
+ return EBUSY;
}
- return (0);
+ return 0;
}
/****************************************************************************/
@@ -1210,10 +1207,10 @@
if (j >= NVRAM_TIMEOUT_COUNT) {
DBPRINT(sc, BNX_WARN, "Timeout reeasing NVRAM lock!\n");
- return (EBUSY);
+ return EBUSY;
}
- return (0);
+ return 0;
}
#ifdef BNX_NVRAM_WRITE_SUPPORT
@@ -1252,11 +1249,11 @@
if (j >= NVRAM_TIMEOUT_COUNT) {
DBPRINT(sc, BNX_WARN, "Timeout writing NVRAM!\n");
- return (EBUSY);
+ return EBUSY;
}
}
- return (0);
+ return 0;
}
/****************************************************************************/
@@ -1342,7 +1339,7 @@
/* Buffered flash doesn't require an erase. */
if (ISSET(sc->bnx_flash_info->flags, BNX_NV_BUFFERED))
- return (0);
+ return 0;
DBPRINT(sc, BNX_VERBOSE, "Erasing NVRAM page.\n");
@@ -1351,7 +1348,7 @@
BNX_NVM_COMMAND_DOIT;
/*
- * Clear the DONE bit separately, set the NVRAM adress to erase,
+ * Clear the DONE bit separately, set the NVRAM address to erase,
* and issue the erase command.
*/
REG_WR(sc, BNX_NVM_COMMAND, BNX_NVM_COMMAND_DONE);
@@ -1371,10 +1368,10 @@
if (j >= NVRAM_TIMEOUT_COUNT) {
DBPRINT(sc, BNX_WARN, "Timeout erasing NVRAM.\n");
- return (EBUSY);
+ return EBUSY;
}
- return (0);
+ return 0;
}
#endif /* BNX_NVRAM_WRITE_SUPPORT */
@@ -1435,7 +1432,7 @@
rc = EBUSY;
}
- return(rc);
+ return rc;
}
#ifdef BNX_NVRAM_WRITE_SUPPORT
@@ -1487,10 +1484,10 @@
if (j >= NVRAM_TIMEOUT_COUNT) {
BNX_PRINTF(sc, "%s(%d): Timeout error writing NVRAM at "
"offset 0x%08X\n", __FILE__, __LINE__, offset);
- return (EBUSY);
+ return EBUSY;
}
- return (0);
+ return 0;
}
#endif /* BNX_NVRAM_WRITE_SUPPORT */
@@ -1565,7 +1562,7 @@
/* Request access to the flash interface. */
if ((rc = bnx_acquire_nvram_lock(sc)) != 0)
- return (rc);
+ return rc;
/* Reconfigure the flash interface. */
bnx_enable_nvram_access(sc);
@@ -1603,7 +1600,7 @@
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
- return (rc);
+ return rc;
}
/****************************************************************************/
@@ -1623,11 +1620,11 @@
u_int32_t cmd_flags, offset32, len32, extra;
if (buf_size == 0)
- return (0);
+ return 0;
/* Request access to the flash interface. */
if ((rc = bnx_acquire_nvram_lock(sc)) != 0)
- return (rc);
+ return rc;
/* Enable access to flash interface */
bnx_enable_nvram_access(sc);
@@ -1655,7 +1652,7 @@
rc = bnx_nvram_read_dword(sc, offset32, buf, cmd_flags);
if (rc)
- return (rc);
+ return rc;
memcpy(ret_buf, buf + (offset & 3), pre_len);
Home |
Main Index |
Thread Index |
Old Index