Merge branch 'master' of github.com:contiki/contiki-mirror
This commit is contained in:
commit
8aff86b2e4
3 changed files with 8 additions and 9 deletions
|
@ -66,11 +66,6 @@ rpl_of_t rpl_of_etx = {
|
|||
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. */
|
||||
#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))) {
|
||||
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
|
||||
|
@ -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;
|
||||
} 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) {
|
||||
base_rank = p->rank;
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
#else
|
||||
#define DEFAULT_MIN_HOPRANKINC RPL_CONF_MIN_HOPRANKINC
|
||||
#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)
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#define QUEUEBUF_CONF_NUM 4
|
||||
|
||||
#undef UIP_CONF_BUFFER_SIZE
|
||||
#define UIP_CONF_BUFFER_SIZE 140
|
||||
#define UIP_CONF_BUFFER_SIZE 1280
|
||||
|
||||
#undef UIP_CONF_RECEIVE_WINDOW
|
||||
#define UIP_CONF_RECEIVE_WINDOW 60
|
||||
|
|
Loading…
Reference in a new issue