|
@@ -168,6 +168,17 @@ 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)
|
|
|
+{
|
|
|
+ if (fls(qth_min) + Wlog > 32)
|
|
|
+ return false;
|
|
|
+ if (fls(qth_max) + Wlog > 32)
|
|
|
+ return false;
|
|
|
+ if (qth_max < qth_min)
|
|
|
+ return false;
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
static inline void red_set_parms(struct red_parms *p,
|
|
|
u32 qth_min, u32 qth_max, u8 Wlog, u8 Plog,
|
|
|
u8 Scell_log, u8 *stab, u32 max_P)
|
|
@@ -179,7 +190,7 @@ static inline void red_set_parms(struct red_parms *p,
|
|
|
p->qth_max = qth_max << Wlog;
|
|
|
p->Wlog = Wlog;
|
|
|
p->Plog = Plog;
|
|
|
- if (delta < 0)
|
|
|
+ if (delta <= 0)
|
|
|
delta = 1;
|
|
|
p->qth_delta = delta;
|
|
|
if (!max_P) {
|