wpan-phy: add wpan-phy iteration functions
[safe/jmp/linux-2.6] / include / net / red.h
index d9e1149..995108e 100644 (file)
@@ -90,8 +90,7 @@
 #define RED_STAB_SIZE  256
 #define RED_STAB_MASK  (RED_STAB_SIZE - 1)
 
-struct red_stats
-{
+struct red_stats {
        u32             prob_drop;      /* Early probability drops */
        u32             prob_mark;      /* Early probability marks */
        u32             forced_drop;    /* Forced drops, qavg > max_thresh */
@@ -101,8 +100,7 @@ struct red_stats
        u32             backlog;
 };
 
-struct red_parms
-{
+struct red_parms {
        /* Parameters */
        u32             qth_min;        /* Min avg length threshold: A scaled */
        u32             qth_max;        /* Max avg length threshold: A scaled */
@@ -156,7 +154,7 @@ static inline int red_is_idling(struct red_parms *p)
 
 static inline void red_start_of_idle_period(struct red_parms *p)
 {
-       PSCHED_GET_TIME(p->qidlestart);
+       p->qidlestart = psched_get_time();
 }
 
 static inline void red_end_of_idle_period(struct red_parms *p)
@@ -177,8 +175,8 @@ static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
        long us_idle;
        int  shift;
 
-       PSCHED_GET_TIME(now);
-       us_idle = PSCHED_TDIFF_SAFE(now, p->qidlestart, p->Scell_max);
+       now = psched_get_time();
+       us_idle = psched_tdiff_bounded(now, p->qidlestart, p->Scell_max);
 
        /*
         * The problem: ideally, average length queue recalcultion should