Skip to contentSkip to conversation

Add descriptions to constants

PATCH In review Ralf Baechle DL5RB 2 participants 3 messages Sep 11, 2005 – Sep 12, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/12 Add descriptions to constants

Comment the names used for the AX.25 state machine.

 include/net/ax25.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
include/net/ax25.h +5 -5
Index: linux-cvs/include/net/ax25.h
===================================================================
@@ -97,11 +97,11 @@
 /* Define Link State constants. */
 
 enum { 
-	AX25_STATE_0,
-	AX25_STATE_1,
-	AX25_STATE_2,
-	AX25_STATE_3,
-	AX25_STATE_4
+	AX25_STATE_0,			/* Listening */
+	AX25_STATE_1,			/* SABM sent */
+	AX25_STATE_2,			/* DISC sent */
+	AX25_STATE_3,			/* Established */
+	AX25_STATE_4			/* Recovery */
 };
 
 #define AX25_MODULUS 		8	/*  Standard AX.25 modulus */
#1 lore raw

Hi Ralf,

Quoted 1 line · Ralf Baechle DL5RB wrote:

Comment the names used for the AX.25 state machine.

What about making it even more useful by aliasing the enum elements?

Quoted 10 lines
 include/net/ax25.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Index: linux-cvs/include/net/ax25.h
===================================================================

include/net/ax25.h line 100

Quoted 9 lines
include/net/ax25.h +1 -5
@@ -97,11 +97,11 @@
 /* Define Link State constants. */
 
 enum {
-	AX25_STATE_0,
-	AX25_STATE_1,
-	AX25_STATE_2,
-	AX25_STATE_3,
-	AX25_STATE_4
+	AX25_STATE_0,			/* Listening */

+ AX25_STATE_LISTENING = AX25_STATE_0,

include/net/ax25.h line 101

Quoted 1 line
include/net/ax25.h +1 -0
+	AX25_STATE_1,			/* SABM sent */

+ AX25_STATE_SABM_SENT = AX25_STATE_1,

include/net/ax25.h line 102

Quoted 1 line
include/net/ax25.h +1 -0
+	AX25_STATE_2,			/* DISC sent */

+ AX25_STATE_DISC_SENT = AX25_STATE_2,

include/net/ax25.h line 103

Quoted 1 line
include/net/ax25.h +1 -0
+	AX25_STATE_3,			/* Established */

+ AX25_STATE_ESTABLISHED = AX25_STATE_3,

include/net/ax25.h line 104

Quoted 1 line
include/net/ax25.h +1 -0
+	AX25_STATE_4			/* Recovery */

+ AX25_STATE_RECOVERY = AX25_STATE_4,

include/net/ax25.h line 105

Quoted 1 line
include/net/ax25.h +0 -0
 };

That would not break backward compatibility and now the state machine can be self explanatory :-)

Regards

Ingo Oeser

#2 lore raw
Quoted 2 lines · Ingo Oeser

That would not break backward compatibility and now the state machine can be self explanatory :-)

The states named by numbers are actually being used in the protocol spec.

Ralf