mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
mii: Simplify mii_resolve_flowctrl_fdx()
This is a shorter and more comprehensible formulation of the conditions for each flow control mode. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4023939667
commit
44c22ee91b
@ -250,18 +250,12 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
|
||||
{
|
||||
u8 cap = 0;
|
||||
|
||||
if (lcladv & ADVERTISE_PAUSE_CAP) {
|
||||
if (lcladv & ADVERTISE_PAUSE_ASYM) {
|
||||
if (rmtadv & LPA_PAUSE_CAP)
|
||||
cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
|
||||
else if (rmtadv & LPA_PAUSE_ASYM)
|
||||
cap = FLOW_CTRL_RX;
|
||||
} else {
|
||||
if (rmtadv & LPA_PAUSE_CAP)
|
||||
cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
|
||||
}
|
||||
} else if (lcladv & ADVERTISE_PAUSE_ASYM) {
|
||||
if ((rmtadv & LPA_PAUSE_CAP) && (rmtadv & LPA_PAUSE_ASYM))
|
||||
if (lcladv & rmtadv & ADVERTISE_PAUSE_CAP) {
|
||||
cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
|
||||
} else if (lcladv & rmtadv & ADVERTISE_PAUSE_ASYM) {
|
||||
if (lcladv & ADVERTISE_PAUSE_CAP)
|
||||
cap = FLOW_CTRL_RX;
|
||||
else if (rmtadv & ADVERTISE_PAUSE_CAP)
|
||||
cap = FLOW_CTRL_TX;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user