Merge branch 'master' of github.com:contiki/contiki-mirror

This commit is contained in:
David Kopf 2012-02-25 10:12:46 -05:00
commit 8aff86b2e4
3 changed files with 8 additions and 9 deletions

View File

@ -66,11 +66,6 @@ rpl_of_t rpl_of_etx = {
1 1
}; };
#define NI_ETX_TO_RPL_ETX(etx) \
((etx) * (RPL_DAG_MC_ETX_DIVISOR / NEIGHBOR_INFO_ETX_DIVISOR))
#define RPL_ETX_TO_NI_ETX(etx) \
((etx) / (RPL_DAG_MC_ETX_DIVISOR / NEIGHBOR_INFO_ETX_DIVISOR))
/* Reject parents that have a higher link metric than the following. */ /* Reject parents that have a higher link metric than the following. */
#define MAX_LINK_METRIC 10 #define MAX_LINK_METRIC 10
@ -90,8 +85,11 @@ calculate_path_metric(rpl_parent_t *p)
{ {
if(p == NULL || (p->mc.obj.etx == 0 && p->rank > ROOT_RANK(p->dag->instance))) { if(p == NULL || (p->mc.obj.etx == 0 && p->rank > ROOT_RANK(p->dag->instance))) {
return MAX_PATH_COST * RPL_DAG_MC_ETX_DIVISOR; return MAX_PATH_COST * RPL_DAG_MC_ETX_DIVISOR;
} else {
long etx = p->link_metric;
etx = (etx * RPL_DAG_MC_ETX_DIVISOR) / NEIGHBOR_INFO_ETX_DIVISOR;
return p->mc.obj.etx + (uint16_t) etx;
} }
return p->mc.obj.etx + NI_ETX_TO_RPL_ETX(p->link_metric);
} }
static void static void
@ -116,7 +114,8 @@ calculate_rank(rpl_parent_t *p, rpl_rank_t base_rank)
} }
rank_increase = NEIGHBOR_INFO_FIX2ETX(INITIAL_LINK_METRIC) * DEFAULT_MIN_HOPRANKINC; rank_increase = NEIGHBOR_INFO_FIX2ETX(INITIAL_LINK_METRIC) * DEFAULT_MIN_HOPRANKINC;
} else { } else {
rank_increase = NEIGHBOR_INFO_FIX2ETX(p->link_metric) * p->dag->instance->min_hoprankinc; /* multiply first, then scale down to avoid truncation effects */
rank_increase = NEIGHBOR_INFO_FIX2ETX(p->link_metric * p->dag->instance->min_hoprankinc);
if(base_rank == 0) { if(base_rank == 0) {
base_rank = p->rank; base_rank = p->rank;
} }

View File

@ -129,7 +129,7 @@
#else #else
#define DEFAULT_MIN_HOPRANKINC RPL_CONF_MIN_HOPRANKINC #define DEFAULT_MIN_HOPRANKINC RPL_CONF_MIN_HOPRANKINC
#endif #endif
#define DEFAULT_MAX_RANKINC (3 * DEFAULT_MIN_HOPRANKINC) #define DEFAULT_MAX_RANKINC (7 * DEFAULT_MIN_HOPRANKINC)
#define DAG_RANK(fixpt_rank, instance) ((fixpt_rank) / (instance)->min_hoprankinc) #define DAG_RANK(fixpt_rank, instance) ((fixpt_rank) / (instance)->min_hoprankinc)

View File

@ -37,7 +37,7 @@
#define QUEUEBUF_CONF_NUM 4 #define QUEUEBUF_CONF_NUM 4
#undef UIP_CONF_BUFFER_SIZE #undef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 140 #define UIP_CONF_BUFFER_SIZE 1280
#undef UIP_CONF_RECEIVE_WINDOW #undef UIP_CONF_RECEIVE_WINDOW
#define UIP_CONF_RECEIVE_WINDOW 60 #define UIP_CONF_RECEIVE_WINDOW 60