Lines Matching defs:state
55 "Gilbert-Elliot" model, a 4-state markov model.
129 /* state of the Markov chain */
130 u8 state;
171 static void init_crandom(struct crndstate *state, unsigned long rho)
173 state->rho = rho;
174 state->last = prandom_u32();
181 static u32 get_crandom(struct crndstate *state)
186 if (!state || state->rho == 0) /* no correlation */
190 rho = (u64)state->rho + 1;
191 answer = (value * ((1ull<<32) - rho) + state->last * rho) >> 32;
192 state->last = answer;
196 /* loss_4state - 4-state model loss generator
197 * Generates losses according to the 4-state Markov chain adopted in
207 * probabilities outgoing from the current state, then decides the
208 * next state and if the next packet has to be transmitted or lost.
215 switch (clg->state) {
218 clg->state = LOST_IN_BURST_PERIOD;
221 clg->state = LOST_IN_GAP_PERIOD;
224 clg->state = TX_IN_GAP_PERIOD;
230 clg->state = LOST_IN_GAP_PERIOD;
233 clg->state = TX_IN_BURST_PERIOD;
239 clg->state = TX_IN_BURST_PERIOD;
241 clg->state = TX_IN_GAP_PERIOD;
243 clg->state = LOST_IN_GAP_PERIOD;
248 clg->state = TX_IN_GAP_PERIOD;
260 * probabilities outgoing from the current state, then decides the
261 * next state. A second random number is extracted and the comparison
262 * with the loss probability of the current state decides if the next
269 switch (clg->state) {
272 clg->state = BAD_STATE;
278 clg->state = GOOD_STATE;
294 /* 4state loss model algorithm (used also for GI model)
295 * Extracts a value from the markov 4 state loss generator,
319 struct crndstate *state,
329 rnd = get_crandom(state);
877 q->clg.state = TX_IN_GAP_PERIOD;
895 q->clg.state = GOOD_STATE;