MFhead@r312226
This commit is contained in:
parent
193d14e967
commit
c70c52faec
@ -845,6 +845,7 @@ static int
|
||||
arswitch_setled(struct arswitch_softc *sc, int phy, int led, int style)
|
||||
{
|
||||
int shift;
|
||||
int err;
|
||||
|
||||
if (phy < 0 || phy > sc->numphys)
|
||||
return EINVAL;
|
||||
@ -852,10 +853,15 @@ arswitch_setled(struct arswitch_softc *sc, int phy, int led, int style)
|
||||
if (style < 0 || style > ETHERSWITCH_PORT_LED_MAX)
|
||||
return (EINVAL);
|
||||
|
||||
ARSWITCH_LOCK(sc);
|
||||
|
||||
shift = ar8327_led_mapping[phy][led].shift;
|
||||
return (arswitch_modifyreg(sc->sc_dev,
|
||||
err = (arswitch_modifyreg(sc->sc_dev,
|
||||
ar8327_led_mapping[phy][led].reg,
|
||||
0x03 << shift, led_pattern_table[style] << shift));
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -81,6 +81,8 @@ static int
|
||||
ar7240_hw_global_setup(struct arswitch_softc *sc)
|
||||
{
|
||||
|
||||
ARSWITCH_LOCK(sc);
|
||||
|
||||
/* Enable CPU port; disable mirror port */
|
||||
arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
|
||||
AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
|
||||
@ -103,6 +105,8 @@ ar7240_hw_global_setup(struct arswitch_softc *sc)
|
||||
arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
|
||||
AR8X16_SERVICE_TAG_MASK, 0);
|
||||
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,8 @@ static int
|
||||
ar8316_hw_global_setup(struct arswitch_softc *sc)
|
||||
{
|
||||
|
||||
ARSWITCH_LOCK(sc);
|
||||
|
||||
arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC);
|
||||
|
||||
/* Enable CPU port and disable mirror port. */
|
||||
@ -156,6 +158,7 @@ ar8316_hw_global_setup(struct arswitch_softc *sc)
|
||||
arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
|
||||
AR8X16_SERVICE_TAG_MASK, 0);
|
||||
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -708,6 +708,8 @@ ar8327_hw_global_setup(struct arswitch_softc *sc)
|
||||
{
|
||||
uint32_t t;
|
||||
|
||||
ARSWITCH_LOCK(sc);
|
||||
|
||||
/* enable CPU port and disable mirror port */
|
||||
t = AR8327_FWD_CTRL0_CPU_PORT_EN |
|
||||
AR8327_FWD_CTRL0_MIRROR_PORT;
|
||||
@ -741,6 +743,7 @@ ar8327_hw_global_setup(struct arswitch_softc *sc)
|
||||
/* GMAC0 (CPU), GMAC1..5 (PHYs), GMAC6 (CPU) */
|
||||
sc->info.es_nports = 7;
|
||||
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -81,6 +81,8 @@ static int
|
||||
ar9340_hw_global_setup(struct arswitch_softc *sc)
|
||||
{
|
||||
|
||||
ARSWITCH_LOCK(sc);
|
||||
|
||||
/* Enable CPU port; disable mirror port */
|
||||
arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
|
||||
AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
|
||||
@ -142,6 +144,7 @@ ar9340_hw_global_setup(struct arswitch_softc *sc)
|
||||
} else {
|
||||
device_printf(sc->sc_dev, "%s: need is_gmii or is_mii set\n",
|
||||
__func__);
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
@ -163,6 +166,7 @@ ar9340_hw_global_setup(struct arswitch_softc *sc)
|
||||
/* Settle time */
|
||||
DELAY(1000);
|
||||
|
||||
ARSWITCH_UNLOCK(sc);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ acct_test.o: convert.c
|
||||
|
||||
convert.c: ${SRCTOP}/sys/kern/kern_acct.c
|
||||
sed -n -e 's/log(/syslog(/g' \
|
||||
-e 's/exp/expected/g' \
|
||||
-e 's/exp/exponent/g' \
|
||||
-e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp
|
||||
mv ${.TARGET}.tmp ${.TARGET}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user