diff options
Diffstat (limited to 'include/net/red.h')
-rw-r--r-- | include/net/red.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/net/red.h b/include/net/red.h index 17821f66de11..117a3654d319 100644 --- a/include/net/red.h +++ b/include/net/red.h @@ -167,16 +167,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, u8 Scell_log) +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; } |