aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mii.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-04-29 04:15:05 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-29 20:32:35 -0400
commit44c22ee91b56d7cad3b48c439dd96aad2e910fbc (patch)
tree557bcb46fb7b7445402c0eed12c3d33729cae7bf /include/linux/mii.h
parent4023939667a906f0c02022ce7ec06d6512470211 (diff)
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>
Diffstat (limited to 'include/linux/mii.h')
-rw-r--r--include/linux/mii.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/mii.h b/include/linux/mii.h
index ad748588faf1..14ecb2e114f1 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -250,18 +250,12 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
250{ 250{
251 u8 cap = 0; 251 u8 cap = 0;
252 252
253 if (lcladv & ADVERTISE_PAUSE_CAP) { 253 if (lcladv & rmtadv & ADVERTISE_PAUSE_CAP) {
254 if (lcladv & ADVERTISE_PAUSE_ASYM) { 254 cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
255 if (rmtadv & LPA_PAUSE_CAP) 255 } else if (lcladv & rmtadv & ADVERTISE_PAUSE_ASYM) {
256 cap = FLOW_CTRL_TX | FLOW_CTRL_RX; 256 if (lcladv & ADVERTISE_PAUSE_CAP)
257 else if (rmtadv & LPA_PAUSE_ASYM) 257 cap = FLOW_CTRL_RX;
258 cap = FLOW_CTRL_RX; 258 else if (rmtadv & ADVERTISE_PAUSE_CAP)
259 } else {
260 if (rmtadv & LPA_PAUSE_CAP)
261 cap = FLOW_CTRL_TX | FLOW_CTRL_RX;
262 }
263 } else if (lcladv & ADVERTISE_PAUSE_ASYM) {
264 if ((rmtadv & LPA_PAUSE_CAP) && (rmtadv & LPA_PAUSE_ASYM))
265 cap = FLOW_CTRL_TX; 259 cap = FLOW_CTRL_TX;
266 } 260 }
267 261