diff options
Diffstat (limited to 'include/net/red.h')
-rw-r--r-- | include/net/red.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/red.h b/include/net/red.h index 5918f78d36a0..9665582c4687 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -168,6 +168,17 @@ static inline void red_set_vars(struct red_vars *v) | |||
168 | v->qcount = -1; | 168 | v->qcount = -1; |
169 | } | 169 | } |
170 | 170 | ||
171 | static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog) | ||
172 | { | ||
173 | if (fls(qth_min) + Wlog > 32) | ||
174 | return false; | ||
175 | if (fls(qth_max) + Wlog > 32) | ||
176 | return false; | ||
177 | if (qth_max < qth_min) | ||
178 | return false; | ||
179 | return true; | ||
180 | } | ||
181 | |||
171 | static inline void red_set_parms(struct red_parms *p, | 182 | static inline void red_set_parms(struct red_parms *p, |
172 | u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog, | 183 | u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog, |
173 | u8 Scell_log, u8 *stab, u32 max_P) | 184 | u8 Scell_log, u8 *stab, u32 max_P) |