diff options
author | Stefan Rompf <stefan@loplof.de> | 2006-03-20 20:09:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 20:09:11 -0500 |
commit | b00055aacdb172c05067612278ba27265fcd05ce (patch) | |
tree | 4dbbee11b02d54cc0978113dfb07c53fdce17aa8 /net/core/dev.c | |
parent | e843b9e1bec4a953d848a319da6a18ca5c667f55 (diff) |
[NET] core: add RFC2863 operstate
this patch adds a dormant flag to network devices, RFC2863 operstate derived
from these flags and possibility for userspace interaction. It allows drivers
to signal that a device is unusable for user traffic without disabling
queueing (and therefore the possibility for protocol establishment traffic to
flow) and a userspace supplicant (WPA, 802.1X) to mark a device unusable
without changes to the driver.
It is the result of our long discussion. However I must admit that it
represents what Jamal and I agreed on with compromises towards Krzysztof, but
Thomas and Krzysztof still disagree with some parts. Anyway I think it should
be applied.
Signed-off-by: Stefan Rompf <stefan@loplof.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ef56c035d44e..8763c99fcb84 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2174,12 +2174,20 @@ unsigned dev_get_flags(const struct net_device *dev) | |||
2174 | 2174 | ||
2175 | flags = (dev->flags & ~(IFF_PROMISC | | 2175 | flags = (dev->flags & ~(IFF_PROMISC | |
2176 | IFF_ALLMULTI | | 2176 | IFF_ALLMULTI | |
2177 | IFF_RUNNING)) | | 2177 | IFF_RUNNING | |
2178 | IFF_LOWER_UP | | ||
2179 | IFF_DORMANT)) | | ||
2178 | (dev->gflags & (IFF_PROMISC | | 2180 | (dev->gflags & (IFF_PROMISC | |
2179 | IFF_ALLMULTI)); | 2181 | IFF_ALLMULTI)); |
2180 | 2182 | ||
2181 | if (netif_running(dev) && netif_carrier_ok(dev)) | 2183 | if (netif_running(dev)) { |
2182 | flags |= IFF_RUNNING; | 2184 | if (netif_oper_up(dev)) |
2185 | flags |= IFF_RUNNING; | ||
2186 | if (netif_carrier_ok(dev)) | ||
2187 | flags |= IFF_LOWER_UP; | ||
2188 | if (netif_dormant(dev)) | ||
2189 | flags |= IFF_DORMANT; | ||
2190 | } | ||
2183 | 2191 | ||
2184 | return flags; | 2192 | return flags; |
2185 | } | 2193 | } |