Documentation: bring operstate documentation up-to-date

Netlink has moved from bitmasks to group numbers long ago.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jouke Witteveen 2019-02-07 17:14:32 +01:00 committed by David S. Miller
parent 4d73eaee24
commit 989723b00b
2 changed files with 9 additions and 7 deletions

View File

@ -22,8 +22,9 @@ and changeable from userspace under certain rules.
2. Querying from userspace 2. Querying from userspace
Both admin and operational state can be queried via the netlink Both admin and operational state can be queried via the netlink
operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK
to be notified of updates. This is important for setting from userspace. to be notified of updates while the interface is admin up. This is
important for setting from userspace.
These values contain interface state: These values contain interface state:
@ -101,8 +102,9 @@ because some driver controlled protocol establishment has to
complete. Corresponding functions are netif_dormant_on() to set the complete. Corresponding functions are netif_dormant_on() to set the
flag, netif_dormant_off() to clear it and netif_dormant() to query. flag, netif_dormant_off() to clear it and netif_dormant() to query.
On device allocation, networking core sets the flags equivalent to On device allocation, both flags __LINK_STATE_NOCARRIER and
netif_carrier_ok() and !netif_dormant(). __LINK_STATE_DORMANT are cleared, so the effective state is equivalent
to netif_carrier_ok() and !netif_dormant().
Whenever the driver CHANGES one of these flags, a workqueue event is Whenever the driver CHANGES one of these flags, a workqueue event is
@ -133,11 +135,11 @@ netif_carrier_ok() && !netif_dormant() is set by the
driver. Afterwards, the userspace application can set IFLA_OPERSTATE driver. Afterwards, the userspace application can set IFLA_OPERSTATE
to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
netif_carrier_off() or netif_dormant_on(). Changes made by userspace netif_carrier_off() or netif_dormant_on(). Changes made by userspace
are multicasted on the netlink group RTMGRP_LINK. are multicasted on the netlink group RTNLGRP_LINK.
So basically a 802.1X supplicant interacts with the kernel like this: So basically a 802.1X supplicant interacts with the kernel like this:
-subscribe to RTMGRP_LINK -subscribe to RTNLGRP_LINK
-set IFLA_LINKMODE to 1 via RTM_SETLINK -set IFLA_LINKMODE to 1 via RTM_SETLINK
-query RTM_GETLINK once to get initial state -query RTM_GETLINK once to get initial state
-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until -if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until

View File

@ -500,7 +500,7 @@ static void dev_watchdog_down(struct net_device *dev)
* netif_carrier_on - set carrier * netif_carrier_on - set carrier
* @dev: network device * @dev: network device
* *
* Device has detected that carrier. * Device has detected acquisition of carrier.
*/ */
void netif_carrier_on(struct net_device *dev) void netif_carrier_on(struct net_device *dev)
{ {