[TIPC]: Minor cleanup of message header code
authorAllan Stephens <allan.stephens@windriver.com>
Thu, 6 Mar 2008 23:06:55 +0000 (15:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Mar 2008 23:06:55 +0000 (15:06 -0800)
This patch eliminates some unused or duplicate message header
symbols, and fixes up the comments and/or location of a few
other symbols.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c
net/tipc/msg.c
net/tipc/msg.h
net/tipc/port.c

index cefa99824c58a1a1f061db74b6491ec09805d7cf..a42f4343010118d0e05736a715412b5b7f663f6b 100644 (file)
@@ -2832,15 +2832,15 @@ static void link_set_supervision_props(struct link *l_ptr, u32 tolerance)
 void tipc_link_set_queue_limits(struct link *l_ptr, u32 window)
 {
        /* Data messages from this node, inclusive FIRST_FRAGM */
-       l_ptr->queue_limit[DATA_LOW] = window;
-       l_ptr->queue_limit[DATA_MEDIUM] = (window / 3) * 4;
-       l_ptr->queue_limit[DATA_HIGH] = (window / 3) * 5;
-       l_ptr->queue_limit[DATA_CRITICAL] = (window / 3) * 6;
+       l_ptr->queue_limit[TIPC_LOW_IMPORTANCE] = window;
+       l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE] = (window / 3) * 4;
+       l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE] = (window / 3) * 5;
+       l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE] = (window / 3) * 6;
        /* Transiting data messages,inclusive FIRST_FRAGM */
-       l_ptr->queue_limit[DATA_LOW + 4] = 300;
-       l_ptr->queue_limit[DATA_MEDIUM + 4] = 600;
-       l_ptr->queue_limit[DATA_HIGH + 4] = 900;
-       l_ptr->queue_limit[DATA_CRITICAL + 4] = 1200;
+       l_ptr->queue_limit[TIPC_LOW_IMPORTANCE + 4] = 300;
+       l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE + 4] = 600;
+       l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900;
+       l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200;
        l_ptr->queue_limit[CONN_MANAGER] = 1200;
        l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200;
        l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500;
index 782485468fb2a1445a29317643ee66b617fe5099..696a8633df757fe1558e31add35019310de361e2 100644 (file)
@@ -73,10 +73,10 @@ void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str
                tipc_printf(buf, "NO(%u/%u):",msg_long_msgno(msg),
                            msg_fragm_no(msg));
                break;
-       case DATA_LOW:
-       case DATA_MEDIUM:
-       case DATA_HIGH:
-       case DATA_CRITICAL:
+       case TIPC_LOW_IMPORTANCE:
+       case TIPC_MEDIUM_IMPORTANCE:
+       case TIPC_HIGH_IMPORTANCE:
+       case TIPC_CRITICAL_IMPORTANCE:
                tipc_printf(buf, "DAT%u:", msg_user(msg));
                if (msg_short(msg)) {
                        tipc_printf(buf, "CON:");
@@ -229,10 +229,10 @@ void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str
        switch (usr) {
        case CONN_MANAGER:
        case NAME_DISTRIBUTOR:
-       case DATA_LOW:
-       case DATA_MEDIUM:
-       case DATA_HIGH:
-       case DATA_CRITICAL:
+       case TIPC_LOW_IMPORTANCE:
+       case TIPC_MEDIUM_IMPORTANCE:
+       case TIPC_HIGH_IMPORTANCE:
+       case TIPC_CRITICAL_IMPORTANCE:
                if (msg_short(msg))
                        break;  /* No error */
                switch (msg_errcode(msg)) {
index 12f8945e8a54e058f034ca11bb2b3a64e47d13f0..5cf76a4f28e43903bb68abd25afc8d893df2ef6d 100644 (file)
 #include "core.h"
 
 #define TIPC_VERSION              2
-#define DATA_LOW                  TIPC_LOW_IMPORTANCE
-#define DATA_MEDIUM               TIPC_MEDIUM_IMPORTANCE
-#define DATA_HIGH                 TIPC_HIGH_IMPORTANCE
-#define DATA_CRITICAL             TIPC_CRITICAL_IMPORTANCE
-#define SHORT_H_SIZE              24   /* Connected,in cluster */
+
+#define SHORT_H_SIZE              24   /* Connected, in-cluster messages */
 #define DIR_MSG_H_SIZE            32   /* Directly addressed messages */
-#define CONN_MSG_H_SIZE           36   /* Routed connected msgs*/
-#define LONG_H_SIZE               40   /* Named Messages */
+#define LONG_H_SIZE               40   /* Named messages */
 #define MCAST_H_SIZE              44   /* Multicast messages */
-#define MAX_H_SIZE                60   /* Inclusive full options */
+#define INT_H_SIZE                40   /* Internal messages */
+#define MIN_H_SIZE                24   /* Smallest legal TIPC header size */
+#define MAX_H_SIZE                60   /* Largest possible TIPC header size */
+
 #define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE)
-#define LINK_CONFIG               13
 
 
 /*
@@ -97,7 +95,7 @@ static inline u32 msg_user(struct tipc_msg *m)
 
 static inline u32 msg_isdata(struct tipc_msg *m)
 {
-       return (msg_user(m) <= DATA_CRITICAL);
+       return (msg_user(m) <= TIPC_CRITICAL_IMPORTANCE);
 }
 
 static inline void msg_set_user(struct tipc_msg *m, u32 n)
@@ -365,7 +363,6 @@ static inline struct tipc_msg *msg_get_wrapped(struct tipc_msg *m)
 #define  NAME_DISTRIBUTOR     11
 #define  MSG_FRAGMENTER       12
 #define  LINK_CONFIG          13
-#define  INT_H_SIZE           40
 #define  DSC_H_SIZE           40
 
 /*
index 2a16ca43e9534fb3a1c64a0f214700265ecbbb6d..e2646a96935df6edad1a8f7c39885d8f244aca41 100644 (file)
@@ -242,7 +242,8 @@ u32 tipc_createport_raw(void *usr_handle,
        p_ptr->publ.max_pkt = MAX_PKT_DEFAULT;
        p_ptr->publ.ref = ref;
        msg = &p_ptr->publ.phdr;
-       msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 0);
+       msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE,
+                0);
        msg_set_orignode(msg, tipc_own_addr);
        msg_set_prevnode(msg, tipc_own_addr);
        msg_set_origport(msg, ref);
@@ -625,7 +626,7 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
                                             msg_orignode(msg),
                                             msg_destport(msg),
                                             tipc_own_addr,
-                                            DATA_HIGH,
+                                            TIPC_HIGH_IMPORTANCE,
                                             TIPC_CONN_MSG,
                                             err,
                                             0,