From b2f55b42a574c530f353946ce3dc31bbffe715b7 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 29 Apr 2009 08:19:03 +0000 Subject: [PATCH] --- yaml --- r: 150070 b: refs/heads/master c: a8c30832b5b12e5d4e9d1c20cdac3cc2880e08b8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/mii.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 235009ab283b..ffa3a27bbb44 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44c22ee91b56d7cad3b48c439dd96aad2e910fbc +refs/heads/master: a8c30832b5b12e5d4e9d1c20cdac3cc2880e08b8 diff --git a/trunk/include/linux/mii.h b/trunk/include/linux/mii.h index 14ecb2e114f1..359fba880274 100644 --- a/trunk/include/linux/mii.h +++ b/trunk/include/linux/mii.h @@ -239,6 +239,22 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock, return 0; } +/** + * mii_advertise_flowctrl - get flow control advertisement flags + * @cap: Flow control capabilities (FLOW_CTRL_RX, FLOW_CTRL_TX or both) + */ +static inline u16 mii_advertise_flowctrl(int cap) +{ + u16 adv = 0; + + if (cap & FLOW_CTRL_RX) + adv = ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; + if (cap & FLOW_CTRL_TX) + adv ^= ADVERTISE_PAUSE_ASYM; + + return adv; +} + /** * mii_resolve_flowctrl_fdx * @lcladv: value of MII ADVERTISE register