Skip to content

Commit 8b84cc4

Browse files
ecsvsimonwunderlich
authored andcommitted
batman-adv: Use inline kernel-doc for enum/struct
The inline kernel-doc comments make it easier to keep changes to the struct/enum synchronized with the documentation of the it. And it makes it easier for larger structures like struct batadv_priv to read the documentation inside the code. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
1 parent 7e9a8c2 commit 8b84cc4

File tree

6 files changed

+1444
-636
lines changed

6 files changed

+1444
-636
lines changed

net/batman-adv/bat_iv_ogm.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,23 @@ static void batadv_iv_send_outstanding_bat_ogm_packet(struct work_struct *work);
7373

7474
/**
7575
* enum batadv_dup_status - duplicate status
76-
* @BATADV_NO_DUP: the packet is no duplicate
77-
* @BATADV_ORIG_DUP: OGM is a duplicate in the originator (but not for the
78-
* neighbor)
79-
* @BATADV_NEIGH_DUP: OGM is a duplicate for the neighbor
80-
* @BATADV_PROTECTED: originator is currently protected (after reboot)
8176
*/
8277
enum batadv_dup_status {
78+
/** @BATADV_NO_DUP: the packet is no duplicate */
8379
BATADV_NO_DUP = 0,
80+
81+
/**
82+
* @BATADV_ORIG_DUP: OGM is a duplicate in the originator (but not for
83+
* the neighbor)
84+
*/
8485
BATADV_ORIG_DUP,
86+
87+
/** @BATADV_NEIGH_DUP: OGM is a duplicate for the neighbor */
8588
BATADV_NEIGH_DUP,
89+
90+
/**
91+
* @BATADV_PROTECTED: originator is currently protected (after reboot)
92+
*/
8693
BATADV_PROTECTED,
8794
};
8895

net/batman-adv/gateway_common.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ enum batadv_gw_modes {
3333

3434
/**
3535
* enum batadv_bandwidth_units - bandwidth unit types
36-
* @BATADV_BW_UNIT_KBIT: unit type kbit
37-
* @BATADV_BW_UNIT_MBIT: unit type mbit
3836
*/
3937
enum batadv_bandwidth_units {
38+
/** @BATADV_BW_UNIT_KBIT: unit type kbit */
4039
BATADV_BW_UNIT_KBIT,
40+
41+
/** @BATADV_BW_UNIT_MBIT: unit type mbit */
4142
BATADV_BW_UNIT_MBIT,
4243
};
4344

net/batman-adv/hard-interface.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,40 @@ enum batadv_hard_if_state {
4242

4343
/**
4444
* enum batadv_hard_if_bcast - broadcast avoidance options
45-
* @BATADV_HARDIF_BCAST_OK: Do broadcast on according hard interface
46-
* @BATADV_HARDIF_BCAST_NORECIPIENT: Broadcast not needed, there is no recipient
47-
* @BATADV_HARDIF_BCAST_DUPFWD: There is just the neighbor we got it from
48-
* @BATADV_HARDIF_BCAST_DUPORIG: There is just the originator
4945
*/
5046
enum batadv_hard_if_bcast {
47+
/** @BATADV_HARDIF_BCAST_OK: Do broadcast on according hard interface */
5148
BATADV_HARDIF_BCAST_OK = 0,
49+
50+
/**
51+
* @BATADV_HARDIF_BCAST_NORECIPIENT: Broadcast not needed, there is no
52+
* recipient
53+
*/
5254
BATADV_HARDIF_BCAST_NORECIPIENT,
55+
56+
/**
57+
* @BATADV_HARDIF_BCAST_DUPFWD: There is just the neighbor we got it
58+
* from
59+
*/
5360
BATADV_HARDIF_BCAST_DUPFWD,
61+
62+
/** @BATADV_HARDIF_BCAST_DUPORIG: There is just the originator */
5463
BATADV_HARDIF_BCAST_DUPORIG,
5564
};
5665

5766
/**
5867
* enum batadv_hard_if_cleanup - Cleanup modi for soft_iface after slave removal
59-
* @BATADV_IF_CLEANUP_KEEP: Don't automatically delete soft-interface
60-
* @BATADV_IF_CLEANUP_AUTO: Delete soft-interface after last slave was removed
6168
*/
6269
enum batadv_hard_if_cleanup {
70+
/**
71+
* @BATADV_IF_CLEANUP_KEEP: Don't automatically delete soft-interface
72+
*/
6373
BATADV_IF_CLEANUP_KEEP,
74+
75+
/**
76+
* @BATADV_IF_CLEANUP_AUTO: Delete soft-interface after last slave was
77+
* removed
78+
*/
6479
BATADV_IF_CLEANUP_AUTO,
6580
};
6681

net/batman-adv/log.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,33 @@ static inline void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
4545

4646
/**
4747
* enum batadv_dbg_level - available log levels
48-
* @BATADV_DBG_BATMAN: OGM and TQ computations related messages
49-
* @BATADV_DBG_ROUTES: route added / changed / deleted
50-
* @BATADV_DBG_TT: translation table messages
51-
* @BATADV_DBG_BLA: bridge loop avoidance messages
52-
* @BATADV_DBG_DAT: ARP snooping and DAT related messages
53-
* @BATADV_DBG_NC: network coding related messages
54-
* @BATADV_DBG_MCAST: multicast related messages
55-
* @BATADV_DBG_TP_METER: throughput meter messages
56-
* @BATADV_DBG_ALL: the union of all the above log levels
5748
*/
5849
enum batadv_dbg_level {
50+
/** @BATADV_DBG_BATMAN: OGM and TQ computations related messages */
5951
BATADV_DBG_BATMAN = BIT(0),
52+
53+
/** @BATADV_DBG_ROUTES: route added / changed / deleted */
6054
BATADV_DBG_ROUTES = BIT(1),
55+
56+
/** @BATADV_DBG_TT: translation table messages */
6157
BATADV_DBG_TT = BIT(2),
58+
59+
/** @BATADV_DBG_BLA: bridge loop avoidance messages */
6260
BATADV_DBG_BLA = BIT(3),
61+
62+
/** @BATADV_DBG_DAT: ARP snooping and DAT related messages */
6363
BATADV_DBG_DAT = BIT(4),
64+
65+
/** @BATADV_DBG_NC: network coding related messages */
6466
BATADV_DBG_NC = BIT(5),
67+
68+
/** @BATADV_DBG_MCAST: multicast related messages */
6569
BATADV_DBG_MCAST = BIT(6),
70+
71+
/** @BATADV_DBG_TP_METER: throughput meter messages */
6672
BATADV_DBG_TP_METER = BIT(7),
73+
74+
/** @BATADV_DBG_ALL: the union of all the above log levels */
6775
BATADV_DBG_ALL = 255,
6876
};
6977

net/batman-adv/multicast.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,21 @@ struct sk_buff;
2626

2727
/**
2828
* enum batadv_forw_mode - the way a packet should be forwarded as
29-
* @BATADV_FORW_ALL: forward the packet to all nodes (currently via classic
30-
* flooding)
31-
* @BATADV_FORW_SINGLE: forward the packet to a single node (currently via the
32-
* BATMAN unicast routing protocol)
33-
* @BATADV_FORW_NONE: don't forward, drop it
3429
*/
3530
enum batadv_forw_mode {
31+
/**
32+
* @BATADV_FORW_ALL: forward the packet to all nodes (currently via
33+
* classic flooding)
34+
*/
3635
BATADV_FORW_ALL,
36+
37+
/**
38+
* @BATADV_FORW_SINGLE: forward the packet to a single node (currently
39+
* via the BATMAN unicast routing protocol)
40+
*/
3741
BATADV_FORW_SINGLE,
42+
43+
/** @BATADV_FORW_NONE: don't forward, drop it */
3844
BATADV_FORW_NONE,
3945
};
4046

0 commit comments

Comments
 (0)