Commit 06d82c91 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller

[TIPC]: Minor cleanup of message header code

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: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0e0609bb
...@@ -2832,15 +2832,15 @@ static void link_set_supervision_props(struct link *l_ptr, u32 tolerance) ...@@ -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) void tipc_link_set_queue_limits(struct link *l_ptr, u32 window)
{ {
/* Data messages from this node, inclusive FIRST_FRAGM */ /* Data messages from this node, inclusive FIRST_FRAGM */
l_ptr->queue_limit[DATA_LOW] = window; l_ptr->queue_limit[TIPC_LOW_IMPORTANCE] = window;
l_ptr->queue_limit[DATA_MEDIUM] = (window / 3) * 4; l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE] = (window / 3) * 4;
l_ptr->queue_limit[DATA_HIGH] = (window / 3) * 5; l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE] = (window / 3) * 5;
l_ptr->queue_limit[DATA_CRITICAL] = (window / 3) * 6; l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE] = (window / 3) * 6;
/* Transiting data messages,inclusive FIRST_FRAGM */ /* Transiting data messages,inclusive FIRST_FRAGM */
l_ptr->queue_limit[DATA_LOW + 4] = 300; l_ptr->queue_limit[TIPC_LOW_IMPORTANCE + 4] = 300;
l_ptr->queue_limit[DATA_MEDIUM + 4] = 600; l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE + 4] = 600;
l_ptr->queue_limit[DATA_HIGH + 4] = 900; l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900;
l_ptr->queue_limit[DATA_CRITICAL + 4] = 1200; l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200;
l_ptr->queue_limit[CONN_MANAGER] = 1200; l_ptr->queue_limit[CONN_MANAGER] = 1200;
l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200; l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200;
l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500; l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500;
......
...@@ -73,10 +73,10 @@ void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str ...@@ -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), tipc_printf(buf, "NO(%u/%u):",msg_long_msgno(msg),
msg_fragm_no(msg)); msg_fragm_no(msg));
break; break;
case DATA_LOW: case TIPC_LOW_IMPORTANCE:
case DATA_MEDIUM: case TIPC_MEDIUM_IMPORTANCE:
case DATA_HIGH: case TIPC_HIGH_IMPORTANCE:
case DATA_CRITICAL: case TIPC_CRITICAL_IMPORTANCE:
tipc_printf(buf, "DAT%u:", msg_user(msg)); tipc_printf(buf, "DAT%u:", msg_user(msg));
if (msg_short(msg)) { if (msg_short(msg)) {
tipc_printf(buf, "CON:"); tipc_printf(buf, "CON:");
...@@ -229,10 +229,10 @@ void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str ...@@ -229,10 +229,10 @@ void tipc_msg_print(struct print_buf *buf, struct tipc_msg *msg, const char *str
switch (usr) { switch (usr) {
case CONN_MANAGER: case CONN_MANAGER:
case NAME_DISTRIBUTOR: case NAME_DISTRIBUTOR:
case DATA_LOW: case TIPC_LOW_IMPORTANCE:
case DATA_MEDIUM: case TIPC_MEDIUM_IMPORTANCE:
case DATA_HIGH: case TIPC_HIGH_IMPORTANCE:
case DATA_CRITICAL: case TIPC_CRITICAL_IMPORTANCE:
if (msg_short(msg)) if (msg_short(msg))
break; /* No error */ break; /* No error */
switch (msg_errcode(msg)) { switch (msg_errcode(msg)) {
......
...@@ -40,18 +40,16 @@ ...@@ -40,18 +40,16 @@
#include "core.h" #include "core.h"
#define TIPC_VERSION 2 #define TIPC_VERSION 2
#define DATA_LOW TIPC_LOW_IMPORTANCE
#define DATA_MEDIUM TIPC_MEDIUM_IMPORTANCE #define SHORT_H_SIZE 24 /* Connected, in-cluster messages */
#define DATA_HIGH TIPC_HIGH_IMPORTANCE
#define DATA_CRITICAL TIPC_CRITICAL_IMPORTANCE
#define SHORT_H_SIZE 24 /* Connected,in cluster */
#define DIR_MSG_H_SIZE 32 /* Directly addressed 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 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 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) ...@@ -97,7 +95,7 @@ static inline u32 msg_user(struct tipc_msg *m)
static inline u32 msg_isdata(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) 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) ...@@ -365,7 +363,6 @@ static inline struct tipc_msg *msg_get_wrapped(struct tipc_msg *m)
#define NAME_DISTRIBUTOR 11 #define NAME_DISTRIBUTOR 11
#define MSG_FRAGMENTER 12 #define MSG_FRAGMENTER 12
#define LINK_CONFIG 13 #define LINK_CONFIG 13
#define INT_H_SIZE 40
#define DSC_H_SIZE 40 #define DSC_H_SIZE 40
/* /*
......
...@@ -242,7 +242,8 @@ u32 tipc_createport_raw(void *usr_handle, ...@@ -242,7 +242,8 @@ u32 tipc_createport_raw(void *usr_handle,
p_ptr->publ.max_pkt = MAX_PKT_DEFAULT; p_ptr->publ.max_pkt = MAX_PKT_DEFAULT;
p_ptr->publ.ref = ref; p_ptr->publ.ref = ref;
msg = &p_ptr->publ.phdr; 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_orignode(msg, tipc_own_addr);
msg_set_prevnode(msg, tipc_own_addr); msg_set_prevnode(msg, tipc_own_addr);
msg_set_origport(msg, ref); msg_set_origport(msg, ref);
...@@ -625,7 +626,7 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf) ...@@ -625,7 +626,7 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
msg_orignode(msg), msg_orignode(msg),
msg_destport(msg), msg_destport(msg),
tipc_own_addr, tipc_own_addr,
DATA_HIGH, TIPC_HIGH_IMPORTANCE,
TIPC_CONN_MSG, TIPC_CONN_MSG,
err, err,
0, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment