aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/red.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/red.h')
-rw-r--r--include/net/red.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/net/red.h b/include/net/red.h
index 9665582c4687..ff07a7cedf68 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -168,14 +168,24 @@ static inline void red_set_vars(struct red_vars *v)
v->qcount = -1;
}
-static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog)
+static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog,
+ u8 Scell_log, u8 *stab)
{
- if (fls(qth_min) + Wlog > 32)
+ if (fls(qth_min) + Wlog >= 32)
return false;
- if (fls(qth_max) + Wlog > 32)
+ if (fls(qth_max) + Wlog >= 32)
+ return false;
+ if (Scell_log >= 32)
return false;
if (qth_max < qth_min)
return false;
+ if (stab) {
+ int i;
+
+ for (i = 0; i < RED_STAB_SIZE; i++)
+ if (stab[i] >= 32)
+ return false;
+ }
return true;
}