Skip to content

Commit 989723b

Browse files
joukewitteveendavem330
authored andcommitted
Documentation: bring operstate documentation up-to-date
Netlink has moved from bitmasks to group numbers long ago. Signed-off-by: Jouke Witteveen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4d73eae commit 989723b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Documentation/networking/operstates.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ and changeable from userspace under certain rules.
2222
2. Querying from userspace
2323

2424
Both admin and operational state can be queried via the netlink
25-
operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK
26-
to be notified of updates. This is important for setting from userspace.
25+
operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK
26+
to be notified of updates while the interface is admin up. This is
27+
important for setting from userspace.
2728

2829
These values contain interface state:
2930

@@ -101,8 +102,9 @@ because some driver controlled protocol establishment has to
101102
complete. Corresponding functions are netif_dormant_on() to set the
102103
flag, netif_dormant_off() to clear it and netif_dormant() to query.
103104

104-
On device allocation, networking core sets the flags equivalent to
105-
netif_carrier_ok() and !netif_dormant().
105+
On device allocation, both flags __LINK_STATE_NOCARRIER and
106+
__LINK_STATE_DORMANT are cleared, so the effective state is equivalent
107+
to netif_carrier_ok() and !netif_dormant().
106108

107109

108110
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
133135
driver. Afterwards, the userspace application can set IFLA_OPERSTATE
134136
to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
135137
netif_carrier_off() or netif_dormant_on(). Changes made by userspace
136-
are multicasted on the netlink group RTMGRP_LINK.
138+
are multicasted on the netlink group RTNLGRP_LINK.
137139

138140
So basically a 802.1X supplicant interacts with the kernel like this:
139141

140-
-subscribe to RTMGRP_LINK
142+
-subscribe to RTNLGRP_LINK
141143
-set IFLA_LINKMODE to 1 via RTM_SETLINK
142144
-query RTM_GETLINK once to get initial state
143145
-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until

net/sched/sch_generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static void dev_watchdog_down(struct net_device *dev)
500500
* netif_carrier_on - set carrier
501501
* @dev: network device
502502
*
503-
* Device has detected that carrier.
503+
* Device has detected acquisition of carrier.
504504
*/
505505
void netif_carrier_on(struct net_device *dev)
506506
{

0 commit comments

Comments
 (0)