Commit 44c22ee9 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

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: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40239396
...@@ -250,18 +250,12 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv) ...@@ -250,18 +250,12 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
{ {
u8 cap = 0; u8 cap = 0;
if (lcladv & ADVERTISE_PAUSE_CAP) { if (lcladv & rmtadv & ADVERTISE_PAUSE_CAP) {
if (lcladv & ADVERTISE_PAUSE_ASYM) { cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
if (rmtadv & LPA_PAUSE_CAP) } else if (lcladv & rmtadv & ADVERTISE_PAUSE_ASYM) {
cap = FLOW_CTRL_TX | FLOW_CTRL_RX; if (lcladv & ADVERTISE_PAUSE_CAP)
else if (rmtadv & LPA_PAUSE_ASYM) cap = FLOW_CTRL_RX;
cap = FLOW_CTRL_RX; else if (rmtadv & ADVERTISE_PAUSE_CAP)
} 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))
cap = FLOW_CTRL_TX; cap = FLOW_CTRL_TX;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment