rtl8139, ipro1000: Don't shadow "ticks" global variable.
The next commit will make it a "#define" instead of an "extern". I've already submitted this for upstream inclusion in FreeBSD. Sorry for the noisy diff with all the whitespace changes...
This commit is contained in:
@@ -6053,7 +6053,7 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
|
|||||||
struct em_int_delay_info *info;
|
struct em_int_delay_info *info;
|
||||||
struct adapter *adapter;
|
struct adapter *adapter;
|
||||||
u32 regval;
|
u32 regval;
|
||||||
int error, usecs, ticks;
|
int error, usecs, _ticks;
|
||||||
|
|
||||||
info = (struct em_int_delay_info *)arg1;
|
info = (struct em_int_delay_info *)arg1;
|
||||||
usecs = info->value;
|
usecs = info->value;
|
||||||
@@ -6063,21 +6063,21 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
|
|||||||
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
|
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
info->value = usecs;
|
info->value = usecs;
|
||||||
ticks = EM_USECS_TO_TICKS(usecs);
|
_ticks = EM_USECS_TO_TICKS(usecs);
|
||||||
if (info->offset == E1000_ITR) /* units are 256ns here */
|
if (info->offset == E1000_ITR) /* units are 256ns here */
|
||||||
ticks *= 4;
|
_ticks *= 4;
|
||||||
|
|
||||||
adapter = info->adapter;
|
adapter = info->adapter;
|
||||||
|
|
||||||
EM_CORE_LOCK(adapter);
|
EM_CORE_LOCK(adapter);
|
||||||
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
|
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
|
||||||
regval = (regval & ~0xffff) | (ticks & 0xffff);
|
regval = (regval & ~0xffff) | (_ticks & 0xffff);
|
||||||
/* Handle a few special cases. */
|
/* Handle a few special cases. */
|
||||||
switch (info->offset) {
|
switch (info->offset) {
|
||||||
case E1000_RDTR:
|
case E1000_RDTR:
|
||||||
break;
|
break;
|
||||||
case E1000_TIDV:
|
case E1000_TIDV:
|
||||||
if (ticks == 0) {
|
if (_ticks == 0) {
|
||||||
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
|
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
|
||||||
/* Don't write 0 into the TIDV register. */
|
/* Don't write 0 into the TIDV register. */
|
||||||
regval++;
|
regval++;
|
||||||
|
|||||||
@@ -4872,7 +4872,7 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
|
|||||||
u32 regval;
|
u32 regval;
|
||||||
int error;
|
int error;
|
||||||
int usecs;
|
int usecs;
|
||||||
int ticks;
|
int _ticks;
|
||||||
|
|
||||||
info = (struct em_int_delay_info *)arg1;
|
info = (struct em_int_delay_info *)arg1;
|
||||||
usecs = info->value;
|
usecs = info->value;
|
||||||
@@ -4882,21 +4882,21 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
|
|||||||
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
|
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
info->value = usecs;
|
info->value = usecs;
|
||||||
ticks = EM_USECS_TO_TICKS(usecs);
|
_ticks = EM_USECS_TO_TICKS(usecs);
|
||||||
if (info->offset == E1000_ITR) /* units are 256ns here */
|
if (info->offset == E1000_ITR) /* units are 256ns here */
|
||||||
ticks *= 4;
|
_ticks *= 4;
|
||||||
|
|
||||||
adapter = info->adapter;
|
adapter = info->adapter;
|
||||||
|
|
||||||
EM_CORE_LOCK(adapter);
|
EM_CORE_LOCK(adapter);
|
||||||
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
|
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
|
||||||
regval = (regval & ~0xffff) | (ticks & 0xffff);
|
regval = (regval & ~0xffff) | (_ticks & 0xffff);
|
||||||
/* Handle a few special cases. */
|
/* Handle a few special cases. */
|
||||||
switch (info->offset) {
|
switch (info->offset) {
|
||||||
case E1000_RDTR:
|
case E1000_RDTR:
|
||||||
break;
|
break;
|
||||||
case E1000_TIDV:
|
case E1000_TIDV:
|
||||||
if (ticks == 0) {
|
if (_ticks == 0) {
|
||||||
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
|
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
|
||||||
/* Don't write 0 into the TIDV register. */
|
/* Don't write 0 into the TIDV register. */
|
||||||
regval++;
|
regval++;
|
||||||
|
|||||||
@@ -1397,7 +1397,7 @@ rl_tick(void *xsc)
|
|||||||
{
|
{
|
||||||
struct rl_softc *sc = xsc;
|
struct rl_softc *sc = xsc;
|
||||||
struct mii_data *mii;
|
struct mii_data *mii;
|
||||||
int ticks;
|
int _ticks;
|
||||||
|
|
||||||
RL_LOCK_ASSERT(sc);
|
RL_LOCK_ASSERT(sc);
|
||||||
/*
|
/*
|
||||||
@@ -1421,15 +1421,15 @@ rl_tick(void *xsc)
|
|||||||
else
|
else
|
||||||
rl_twister_update(sc);
|
rl_twister_update(sc);
|
||||||
if (sc->rl_twister == DONE)
|
if (sc->rl_twister == DONE)
|
||||||
ticks = hz;
|
_ticks = hz;
|
||||||
else
|
else
|
||||||
ticks = hz / 10;
|
_ticks = hz / 10;
|
||||||
} else {
|
} else {
|
||||||
rl_watchdog(sc);
|
rl_watchdog(sc);
|
||||||
ticks = hz;
|
_ticks = hz;
|
||||||
}
|
}
|
||||||
|
|
||||||
callout_reset(&sc->rl_stat_callout, ticks, rl_tick, sc);
|
callout_reset(&sc->rl_stat_callout, _ticks, rl_tick, sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEVICE_POLLING
|
#ifdef DEVICE_POLLING
|
||||||
|
|||||||
Reference in New Issue
Block a user